WIP decoupling worker/web, cleaning worker code

This commit is contained in:
msramalho
2025-02-08 00:40:35 +00:00
parent 46a5c1a260
commit 9a62f3ff59
19 changed files with 194 additions and 247 deletions

View File

@@ -4,16 +4,17 @@ from fastapi.encoders import jsonable_encoder
from fastapi.responses import JSONResponse
from loguru import logger
from shared.task_messaging import get_celery
from web.security import get_token_or_user_auth
from db import schemas
from core.logging import log_error
from worker.main import celery
from utils.misc import custom_jsonable_encoder
task_router = APIRouter(prefix="/task", tags=["Async task operations"])
celery = get_celery()
@task_router.get("/{task_id}", summary="Check the status of an async task by its id, works for URLs and Sheet tasks.")
def get_status(task_id, email=Depends(get_token_or_user_auth)) -> schemas.TaskResult: