diff --git a/backend/app/app/api/celery_task.py b/backend/app/app/api/celery_task.py index c02a234..be99fbc 100644 --- a/backend/app/app/api/celery_task.py +++ b/backend/app/app/api/celery_task.py @@ -5,7 +5,6 @@ from app.core.celery import celery from app.models.hero_model import Hero from app.db.session import SessionLocal -from asyncer import runnify import logging from celery import Task from transformers import pipeline @@ -67,6 +66,6 @@ async def get_hero(hero_id: UUID) -> Hero: @celery.task(name="tasks.print_hero") -def print_hero(hero_id: UUID) -> None: - hero = runnify(get_hero)(hero_id=hero_id) +def print_hero(hero_id: UUID) -> None: + hero = asyncio.get_event_loop().run_until_complete(get_hero(hero_id=hero_id)) return hero.id