First commit

This commit is contained in:
2026-07-18 15:09:05 +07:00
parent 0e8693882b
commit a34b01a035
29 changed files with 7400 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
from fastapi import APIRouter
from celery.result import AsyncResult
from app.tasks.worker import celery_app
router = APIRouter()
@router.get("/tasks/{task_id}")
async def get_task_status(task_id: str):
res = AsyncResult(task_id, app=celery_app)
response_data = {
"task_id": task_id,
"status": res.status,
}
if res.ready():
if res.successful():
response_data["result"] = res.result
else:
response_data["error"] = str(res.result)
return response_data