diff --git a/storage-app/src/worker.py b/storage-app/src/worker.py index 72ca3d6..632ee6d 100644 --- a/storage-app/src/worker.py +++ b/storage-app/src/worker.py @@ -1,7 +1,7 @@ from celery import Celery from shared.settings import BROKER_URL, RESULT_URL, CELERY_CONFIG from shared.worker_services import Zipper, Hasher, EmbeddingStatus -from asyncio import run +from asyncio import get_event_loop from typing import Optional, Any from json import JSONEncoder, loads, dumps from kombu.serialization import register @@ -29,7 +29,7 @@ def default(self, o) -> Any: return getattr(o, "__json__", super().default)(o) @worker.task(bind=True, name="produce_download_task") def produce_download_task(self, bucket_name: str, file_ids: list[str]) -> str | None: task = Zipper(bucket_name, file_ids, self) - run(task.archive_objects()) + get_event_loop().run_until_complete(task.archive_objects()) return task.archive_id