mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-05 00:38:11 +08:00
+4
-2
@@ -211,7 +211,8 @@ class Sentinel:
|
||||
: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"))
|
||||
@@ -235,7 +236,8 @@ class Sentinel:
|
||||
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()
|
||||
|
||||
Reference in New Issue
Block a user