Skip to content

Commit e3a4741

Browse files
committed
fix test
1 parent 4a06f20 commit e3a4741

File tree

1 file changed

+7
-6
lines changed
  • services/storage/src/simcore_service_storage/modules/celery/backends

1 file changed

+7
-6
lines changed

services/storage/src/simcore_service_storage/modules/celery/backends/_redis.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,24 @@
77
_CELERY_TASK_META_PREFIX: Final[str] = "celery-task-meta-"
88
_CELERY_TASK_ID_KEY_SEPARATOR: Final[str] = ":"
99
_CELERY_TASK_SCAN_COUNT_PER_BATCH: Final[int] = 10000
10+
_CELERY_TASK_ID_KEY_ENCODING = "utf-8"
1011

1112

1213
class RedisTaskStore:
1314
def __init__(self, redis_client_sdk: RedisClientSDK) -> None:
1415
self._redis_client_sdk = redis_client_sdk
1516

1617
async def get_task_uuids(self, task_context: TaskContext) -> set[TaskUUID]:
17-
search_key = (
18-
_CELERY_TASK_META_PREFIX
19-
+ build_task_id_prefix(task_context)
20-
+ _CELERY_TASK_ID_KEY_SEPARATOR
21-
)
18+
search_key = build_task_id_prefix(task_context) + _CELERY_TASK_ID_KEY_SEPARATOR
2219
keys = set()
2320
async for key in self._redis_client_sdk.redis.scan_iter(
2421
match=search_key + "*", count=_CELERY_TASK_SCAN_COUNT_PER_BATCH
2522
):
26-
keys.add(TaskUUID(f"{key}".removeprefix(search_key)))
23+
keys.add(
24+
TaskUUID(
25+
key.decode(_CELERY_TASK_ID_KEY_ENCODING).removeprefix(search_key)
26+
)
27+
)
2728
return keys
2829

2930
async def task_exists(self, task_id: TaskID) -> bool:

0 commit comments

Comments
 (0)