switching from optional response_model to mandatory return type

This commit is contained in:
msramalho
2024-10-29 16:17:40 +00:00
parent aaada7d83f
commit 8c658cdf52
7 changed files with 35 additions and 30 deletions

View File

@@ -14,8 +14,8 @@ from worker.main import celery
task_router = APIRouter(prefix="/task", tags=["Async task operations"])
@task_router.get("/{task_id}", response_model=schemas.TaskResult, 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)):
@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:
logger.info(f"status check for user {email} task {task_id}")
task = AsyncResult(task_id, app=celery)
try: