From fd4052f0555c5c08254bb5374c145e4dada9446c Mon Sep 17 00:00:00 2001 From: Alex Stefanescu Date: Fri, 13 Dec 2024 12:28:52 +0100 Subject: [PATCH] Log when Worker loop is disrupted --- servicelayer/taskqueue.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/servicelayer/taskqueue.py b/servicelayer/taskqueue.py index 93d6542..86b5576 100644 --- a/servicelayer/taskqueue.py +++ b/servicelayer/taskqueue.py @@ -511,6 +511,10 @@ def process_blocking(self): channel.connection.add_callback_threadsafe(cb) except Empty: pass + except Exception: + log.exception(f"Worker loop has been disrupted while handling task" + f" {task.id or 'Unknown ID'} from collection" + f" {task.collection_id or 'Unknown ID'}") finally: clear_contextvars()