Skip to content

Commit

Permalink
Fix issues with register_tasks and empty tasklist (#237)
Browse files Browse the repository at this point in the history
  • Loading branch information
nazywam authored Dec 28, 2023
1 parent 2d10bd4 commit bb8aba6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions karton/core/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit bb8aba6

Please sign in to comment.