Skip to content

Commit 46431e4

Browse files
update
1 parent 4660d31 commit 46431e4

File tree

1 file changed

+4
-3
lines changed
  • services/storage/src/simcore_service_storage/modules/celery

1 file changed

+4
-3
lines changed

services/storage/src/simcore_service_storage/modules/celery/_task.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,13 @@ async def run_task(task_id: TaskID) -> R:
5656
try:
5757
async with asyncio.TaskGroup() as tg:
5858
main_task = tg.create_task(
59-
coro(task, task_id, *args, **kwargs), name=f"task_{task_id}"
59+
coro(task, task_id, *args, **kwargs),
6060
)
6161

6262
async def abort_monitor():
63+
abortable_result = AbortableAsyncResult(task_id, app=app)
6364
while not main_task.done():
64-
if AbortableAsyncResult(task_id, app=app).is_aborted():
65+
if abortable_result.is_aborted():
6566
await cancel_wait_task(
6667
main_task,
6768
max_delay=_DEFAULT_CANCEL_TASK_TIMEOUT.total_seconds(),
@@ -71,7 +72,7 @@ async def abort_monitor():
7172
_DEFAULT_ABORT_TASK_TIMEOUT.total_seconds()
7273
)
7374

74-
tg.create_task(abort_monitor(), name=f"abort_monitor_{task_id}")
75+
tg.create_task(abort_monitor())
7576

7677
return main_task.result()
7778
except BaseExceptionGroup as eg:

0 commit comments

Comments
 (0)