Occasionally try to restore the queue

master
Bob Mottram 2019-09-03 10:11:33 +01:00
parent 86359ba91a
commit d89de123f1
1 changed files with 8 additions and 1 deletions

View File

@ -1183,6 +1183,7 @@ def runInboxQueue(projectVersion: str, \
itemReadFailed=0 itemReadFailed=0
heartBeatCtr=0 heartBeatCtr=0
queueRestoreCtr=0
while True: while True:
time.sleep(1) time.sleep(1)
@ -1193,7 +1194,13 @@ def runInboxQueue(projectVersion: str, \
print('>>> Heartbeat Q:'+str(len(queue))+' '+datetime.datetime.now().strftime("%m/%d/%Y, %H:%M:%S")) print('>>> Heartbeat Q:'+str(len(queue))+' '+datetime.datetime.now().strftime("%m/%d/%Y, %H:%M:%S"))
heartBeatCtr=0 heartBeatCtr=0
if len(queue)>0: if len(queue)==0:
# restore any remaining queue items
queueRestoreCtr+=1
if queueRestoreCtr>=30:
queueRestoreCtr=0
restoreQueueItems(baseDir,queue)
else:
currTime=int(time.time()) currTime=int(time.time())
# recreate the session periodically # recreate the session periodically