Skip to content

Commit

Permalink
Close the sessions before disposing the engines as the engines won't …
Browse files Browse the repository at this point in the history
…close connections held up in sessions.
  • Loading branch information
ionelmc committed Mar 22, 2014
1 parent 688c3fe commit 7be5028
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion celery/backends/database/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ class _after_fork(object):

def __call__(self):
self.registered = False # child must reregister
for session in _SESSIONS:
session.close()
_SESSIONS.clear()
for engine in list(_ENGINES.values()):
engine.dispose()
_ENGINES.clear()
_SESSIONS.clear()
after_fork = _after_fork()


Expand Down

0 comments on commit 7be5028

Please sign in to comment.