@@ -159,6 +159,9 @@ def process_queue_with_threads():
threads[index] = thread
thread.start()
+ except Empty:
+ is_drained = True
+
except Exception as err:
log.error('[process_queue_with_threads] [{}] {}'.format(
station,
@@ -166,9 +169,6 @@ def process_queue_with_threads():
))
continue
- except Empty:
- is_drained = True
-
elif not t.is_alive():
threads[index] = None