mirror of
https://github.com/django-q2/django-q2.git
synced 2026-09-25 13:48:12 +08:00
Fix reincarnation bug
This commit is contained in:
+6
-2
@@ -180,6 +180,10 @@ class Sentinel(object):
|
||||
return self.spawn_process(monitor, self.done_queue)
|
||||
|
||||
def reincarnate(self, process):
|
||||
"""
|
||||
:param process: the process to reincarnate
|
||||
:type process: Process or None
|
||||
"""
|
||||
process.terminate()
|
||||
if process == self.monitor:
|
||||
self.monitor = self.spawn_monitor()
|
||||
@@ -225,10 +229,10 @@ class Sentinel(object):
|
||||
p.timer.value += 1
|
||||
# Check Monitor
|
||||
if not self.monitor.is_alive():
|
||||
self.reincarnate(p)
|
||||
self.reincarnate(self.monitor)
|
||||
# Check Pusher
|
||||
if not self.pusher.is_alive():
|
||||
self.reincarnate(p)
|
||||
self.reincarnate(self.pusher)
|
||||
# Call scheduler once a minute (or so)
|
||||
counter += 1
|
||||
if counter > 60:
|
||||
|
||||
Reference in New Issue
Block a user