Don't wait for ever

master
Bob Mottram 2019-09-03 20:10:50 +01:00
parent 536731f256
commit a6e78fbd7b
1 changed files with 5 additions and 1 deletions

View File

@ -430,8 +430,12 @@ class PubServer(BaseHTTPRequestHandler):
"""
if self.server.outboxThread:
print('Waiting for previous outbox thread to end')
while self.server.outboxThread.isAlive():
waitCtr=0
while self.server.outboxThread.isAlive() and waitCtr<5:
time.sleep(1)
waitCtr+=1
if waitCtr>=5:
self.server.outboxThread.kill()
print('Creating outbox thread')
self.server.outboxThread= \