From 61da9d6af501af720288cf4cc0fe2dc8c942d803 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 3 Sep 2019 09:46:26 +0100 Subject: [PATCH] Add heartbeat to inbox queue --- inbox.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/inbox.py b/inbox.py index 308603efd..ed48cb33b 100644 --- a/inbox.py +++ b/inbox.py @@ -1181,9 +1181,18 @@ def runInboxQueue(projectVersion: str, \ # so that if a file is corrupt then it will eventually # be ignored rather than endlessly retried itemReadFailed=0 - + + heartBeatCtr=0 + while True: - time.sleep(1) + time.sleep(1) + + # heartbeat to monitor whether the inbox queue is running + heartBeatCtr+=1 + if heartBeatCtr>=10: + print('>>> Heartbeat '+datetime.now().strftime("%m/%d/%Y, %H:%M:%S")) + heartBeatCtr=0 + if len(queue)>0: currTime=int(time.time()) @@ -1216,6 +1225,8 @@ def runInboxQueue(projectVersion: str, \ # is probably corrupt/unreadable queue.pop(0) itemReadFailed=0 + # delete the queue file + os.remove(queueFilename) continue itemReadFailed=0