From 63e6399dd4d1456f1c511ee2ef9e2e262bd632ff Mon Sep 17 00:00:00 2001 From: evilhero Date: Wed, 4 Dec 2019 11:40:59 -0500 Subject: [PATCH] attempted fix for when dupechk bombs and/or error occurs in post-processing and hangs queue --- mylar/helpers.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mylar/helpers.py b/mylar/helpers.py index 0ee7df7b..f3b61bf5 100755 --- a/mylar/helpers.py +++ b/mylar/helpers.py @@ -3111,6 +3111,7 @@ def postprocess_main(queue): time.sleep(5) elif mylar.APILOCK is False and queue.qsize() >= 1: #len(queue) > 1: + pp = None item = queue.get(True) logger.info('Now loading from post-processing queue: %s' % item) if item == 'exit': @@ -3125,6 +3126,11 @@ def postprocess_main(queue): pp = pprocess.post_process() time.sleep(5) #arbitrary sleep to let the process attempt to finish pp'ing + if pp is not None: + if pp['mode'] == 'stop': + #reset the lock so any subsequent items can pp and not keep the queue locked up. + mylar.APILOCK = False + if mylar.APILOCK is True: logger.info('Another item is post-processing still...') time.sleep(15)