forked from indymedia/epicyon
Fix cloning of inbox thread
parent
d325501a31
commit
832c1cd39b
5
inbox.py
5
inbox.py
|
@ -1140,13 +1140,14 @@ def runInboxQueueWatchdog(projectVersion: str,httpd) -> None:
|
||||||
"""This tries to keep the inbox thread running even if it dies
|
"""This tries to keep the inbox thread running even if it dies
|
||||||
"""
|
"""
|
||||||
print('Starting inbox queue watchdog')
|
print('Starting inbox queue watchdog')
|
||||||
inboxQueueOriginal=httpd.thrInboxQueue.clone()
|
inboxQueueOriginal=httpd.thrInboxQueue.clone(runInboxQueue)
|
||||||
|
#httpd.thrInboxQueue=inboxQueueOriginal
|
||||||
httpd.thrInboxQueue.start()
|
httpd.thrInboxQueue.start()
|
||||||
while True:
|
while True:
|
||||||
time.sleep(20)
|
time.sleep(20)
|
||||||
if not httpd.thrInboxQueue.isAlive():
|
if not httpd.thrInboxQueue.isAlive():
|
||||||
httpd.thrInboxQueue.kill()
|
httpd.thrInboxQueue.kill()
|
||||||
httpd.thrInboxQueue=inboxQueueOriginal.clone()
|
httpd.thrInboxQueue=inboxQueueOriginal.clone(runInboxQueue)
|
||||||
httpd.thrInboxQueue.start()
|
httpd.thrInboxQueue.start()
|
||||||
print('Restarting inbox queue...')
|
print('Restarting inbox queue...')
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,7 @@ class threadWithTrace(threading.Thread):
|
||||||
def kill(self):
|
def kill(self):
|
||||||
self.killed = True
|
self.killed = True
|
||||||
|
|
||||||
def clone(self):
|
def clone(self,fn):
|
||||||
return threadWithTrace(target=self, \
|
return threadWithTrace(target=fn, \
|
||||||
args=(self._args),daemon=True)
|
args=self._args, \
|
||||||
|
daemon=True)
|
||||||
|
|
Loading…
Reference in New Issue