From e2cd6fbd9f03741611dd7a86a9ecf09aa8b85b3a Mon Sep 17 00:00:00 2001 From: Christian Stefanescu Date: Fri, 24 May 2024 13:31:37 +0200 Subject: [PATCH] Run periodic tasks before handling tasks --- servicelayer/taskqueue.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/servicelayer/taskqueue.py b/servicelayer/taskqueue.py index 7184a54..6818f47 100644 --- a/servicelayer/taskqueue.py +++ b/servicelayer/taskqueue.py @@ -411,6 +411,7 @@ def process_blocking(self): """Blocking worker thread - executes tasks from a queue and periodic tasks""" while True: try: + self.periodic() (task, channel, connection) = self.local_queue.get(timeout=TIMEOUT) apply_task_context(task, v=self.version) self.handle(task) @@ -420,7 +421,6 @@ def process_blocking(self): pass finally: clear_contextvars() - self.periodic() def process_nonblocking(self): """Non-blocking worker is used for tests only."""