diff --git a/karton/core/backend.py b/karton/core/backend.py index 6117adf..bb06c8c 100644 --- a/karton/core/backend.py +++ b/karton/core/backend.py @@ -449,7 +449,7 @@ def get_tasks( chunk_size, ) return [ - Task.unserialize(task_data, parse_resources=parse_resources) + Task.unserialize(task_data, backend=self, parse_resources=parse_resources) for chunk in keys for task_data in self.redis.mget(chunk) if task_data is not None @@ -463,7 +463,9 @@ def _iter_tasks( ) -> Iterator[Task]: for chunk in chunks_iter(task_keys, chunk_size): yield from ( - Task.unserialize(task_data, parse_resources=parse_resources) + Task.unserialize( + task_data, backend=self, parse_resources=parse_resources + ) for task_data in self.redis.mget(chunk) if task_data is not None )