Skip to content

Commit

Permalink
fix worker aio loop
Browse files Browse the repository at this point in the history
  • Loading branch information
githubering182 committed Dec 11, 2024
1 parent 799919f commit 6a98604
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions storage-app/src/worker.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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


Expand Down

0 comments on commit 6a98604

Please sign in to comment.