From 6fc1e233772afb464585cb09816e2106f32d9752 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Praszmo?= Date: Wed, 27 Dec 2023 07:06:55 +0100 Subject: [PATCH] Fix issues with register_tasks and empty tasklist --- karton/core/backend.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/karton/core/backend.py b/karton/core/backend.py index b235c0d..3045b9d 100644 --- a/karton/core/backend.py +++ b/karton/core/backend.py @@ -544,6 +544,10 @@ def register_tasks(self, tasks: List[Task]) -> None: Register or update multiple tasks in Redis. :param tasks: List of task objects """ + # calling mset with an empty dictionary results in a crash + if not tasks: + return + taskmap = { f"{KARTON_TASK_NAMESPACE}:{task.uid}": task.serialize() for task in tasks }