File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed
services/storage/src/simcore_service_storage/modules/celery/backends Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change 1+ import contextlib
12import logging
23from datetime import timedelta
34from typing import Final
@@ -90,7 +91,8 @@ async def list_tasks(self, task_context: TaskContext) -> list[Task]:
9091 search_key_len = len (search_key )
9192
9293 keys : list [str ] = []
93- pipe = self ._redis_client_sdk .redis .pipeline ()
94+
95+ pipeline = self ._redis_client_sdk .redis .pipeline ()
9496 async for key in self ._redis_client_sdk .redis .scan_iter (
9597 match = search_key + "*" , count = _CELERY_TASK_SCAN_COUNT_PER_BATCH
9698 ):
@@ -101,27 +103,24 @@ async def list_tasks(self, task_context: TaskContext) -> list[Task]:
101103 else key
102104 )
103105 keys .append (_key )
104- pipe .hget (_key , _CELERY_TASK_METADATA_KEY )
105106
106- results = await pipe .execute ()
107+ pipeline .hget (_key , _CELERY_TASK_METADATA_KEY )
108+
109+ results = await pipeline .execute ()
107110
108111 tasks = []
109112 for key , raw_metadata in zip (keys , results , strict = True ):
110113 if raw_metadata is None :
111114 continue
112115
113- try :
116+ with contextlib . suppress ( ValidationError ) :
114117 task_metadata = TaskMetadata .model_validate_json (raw_metadata )
115118 tasks .append (
116119 Task (
117120 uuid = TaskUUID (key [search_key_len :]),
118121 metadata = task_metadata ,
119122 )
120123 )
121- except ValidationError as exc :
122- _logger .debug (
123- "Failed to deserialize task metadata for key %s: %s" , key , f"{ exc } "
124- )
125124
126125 return tasks
127126
You can’t perform that action at this time.
0 commit comments