Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,15 @@ def get_task_status(
def _get_completed_task_uuids(self, task_context: TaskContext) -> set[TaskUUID]:
search_key = _CELERY_TASK_META_PREFIX + _build_task_id_prefix(task_context)
backend_client = self._celery_app.backend.client
if hasattr(backend_client, "keys") and (
keys := backend_client.keys(f"{search_key}*")
):
return {
TaskUUID(
f"{key.decode(_CELERY_TASK_ID_KEY_ENCODING).removeprefix(search_key + _CELERY_TASK_ID_KEY_SEPARATOR)}"
)
for key in keys
}
if hasattr(backend_client, "keys"):
if keys := backend_client.keys(f"{search_key}*"):
return {
TaskUUID(
f"{key.decode(_CELERY_TASK_ID_KEY_ENCODING).removeprefix(search_key + _CELERY_TASK_ID_KEY_SEPARATOR)}"
)
for key in keys
}
return set()
if hasattr(backend_client, "cache"):
# NOTE: backend used in testing. It is a dict-like object
found_keys = set()
Expand Down
Loading