celery syncs

This commit is contained in:
Alex
2023-10-01 20:05:13 +01:00
parent a619269502
commit cd9b03bdb9
3 changed files with 6 additions and 4 deletions

View File

@@ -6,7 +6,6 @@ from pymongo import MongoClient
from bson.objectid import ObjectId
from werkzeug.utils import secure_filename
import http.client
from celery.result import AsyncResult
from application.api.user.tasks import ingest
@@ -142,7 +141,8 @@ def upload_file():
def task_status():
"""Get celery job status."""
task_id = request.args.get("task_id")
task = AsyncResult(task_id, backend=settings.CELERY_RESULT_BACKEND)
from application.celery import celery
task = celery.AsyncResult(task_id)
task_meta = task.info
return {"status": task.status, "result": task_meta}