File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
services/storage/src/simcore_service_storage/modules/celery/backends Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 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
1213class 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 :
You can’t perform that action at this time.
0 commit comments