Skip to content

Commit 4e959a6

Browse files
add hack
1 parent 7800e4b commit 4e959a6

File tree

1 file changed

+10
-2
lines changed
  • services/storage/src/simcore_service_storage/modules/celery

1 file changed

+10
-2
lines changed

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import contextlib
2+
import json
23
import logging
34
from typing import Any, Final
45
from uuid import uuid4
@@ -54,8 +55,7 @@ def __init__(self, celery_app: Celery, redis_client_sdk: RedisClientSDK) -> None
5455
self._celery_app = celery_app
5556
self._redis_client_sdk = redis_client_sdk
5657

57-
@make_async()
58-
def send_task(
58+
async def send_task(
5959
self, task_name: str, *, task_context: TaskContext, **task_params
6060
) -> TaskUUID:
6161
task_uuid = uuid4()
@@ -66,6 +66,14 @@ def send_task(
6666
msg=f"Submitting task {task_name}: {task_id=} {task_params=}",
6767
):
6868
self._celery_app.send_task(task_name, task_id=task_id, kwargs=task_params)
69+
await self._redis_client_sdk.redis.set(
70+
_CELERY_TASK_META_PREFIX + task_id,
71+
json.dumps(
72+
{
73+
"status": "PENDING",
74+
}
75+
),
76+
)
6977
return task_uuid
7078

7179
@make_async()

0 commit comments

Comments
 (0)