~james-w/python-timeline-django/timeline-factory

Viewing all changes in revision 23.

  • Committer: James Westby
  • Date: 2014-09-01 14:09:06 UTC
  • mfrom: (22.1.2 clean-env)
  • Revision ID: james.westby@canonical.com-20140901140906-jxhwp4pqvnvu96a7
Be more careful about leaking objects.

1. Register signals with a dispatch_uid so that if register is called
   twice there aren't double receivers. There is a very slim chance that
   someone could two want two sets of receivers with timeline_factories
   that get different timelines. In that case this should be rewritten
   to not use dispatch_uid and offer a disconnect method that can be
   used in tests etc.

2. Re-set the environ stored in the thread local after the wsgi response
   is delivered. In a case where some requests go through wsgi and some
   don't (e.g. tests) the environ would leak in to those that don't use
   wsgi. This could lead to an ever-growing timeline.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: