Skip to content

Commit

Permalink
Fix #422
Browse files Browse the repository at this point in the history
  • Loading branch information
KonstantinSchubert committed Jun 4, 2020
1 parent 56982bd commit b951a19
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions django_q/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ def reincarnate(self, process):
:param process: the process to reincarnate
:type process: Process or None
"""
close_old_django_connections()
if not Conf.SYNC:
db.connections.close_all() # Close any old connections
if process == self.monitor:
self.monitor = self.spawn_monitor()
logger.error(_(f"reincarnated monitor {process.name} after sudden death"))
Expand All @@ -225,7 +226,8 @@ def reincarnate(self, process):
def spawn_cluster(self):
self.pool = []
Stat(self).save()
close_old_django_connections()
if not Conf.SYNC:
db.connection.close()
# spawn worker pool
for __ in range(self.pool_size):
self.spawn_worker()
Expand Down

0 comments on commit b951a19

Please sign in to comment.