forked from indymedia/epicyon
Add heartbeat to inbox queue
parent
5ca2b1c762
commit
61da9d6af5
11
inbox.py
11
inbox.py
|
@ -1182,8 +1182,17 @@ def runInboxQueue(projectVersion: str, \
|
||||||
# be ignored rather than endlessly retried
|
# be ignored rather than endlessly retried
|
||||||
itemReadFailed=0
|
itemReadFailed=0
|
||||||
|
|
||||||
|
heartBeatCtr=0
|
||||||
|
|
||||||
while True:
|
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:
|
if len(queue)>0:
|
||||||
currTime=int(time.time())
|
currTime=int(time.time())
|
||||||
|
|
||||||
|
@ -1216,6 +1225,8 @@ def runInboxQueue(projectVersion: str, \
|
||||||
# is probably corrupt/unreadable
|
# is probably corrupt/unreadable
|
||||||
queue.pop(0)
|
queue.pop(0)
|
||||||
itemReadFailed=0
|
itemReadFailed=0
|
||||||
|
# delete the queue file
|
||||||
|
os.remove(queueFilename)
|
||||||
continue
|
continue
|
||||||
itemReadFailed=0
|
itemReadFailed=0
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue