From a6e78fbd7b367d6a7ef6cf4df12e2b6717ad24fe Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 3 Sep 2019 20:10:50 +0100 Subject: [PATCH] Don't wait for ever --- daemon.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/daemon.py b/daemon.py index 9187166b..87d7d2ad 100644 --- a/daemon.py +++ b/daemon.py @@ -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= \