From ae2ded119fbdab8e37554a06928824547133e9e7 Mon Sep 17 00:00:00 2001 From: xucai Date: Wed, 12 Jun 2024 19:48:28 +0800 Subject: [PATCH] rename celery_init.py --- application/api/user/routes.py | 2 +- application/api/user/tasks.py | 2 +- application/app.py | 2 +- application/{celery.py => celery_init.py} | 0 tests/test_celery.py | 2 +- 5 files changed, 4 insertions(+), 4 deletions(-) rename application/{celery.py => celery_init.py} (100%) diff --git a/application/api/user/routes.py b/application/api/user/routes.py index 51101492..443faddc 100644 --- a/application/api/user/routes.py +++ b/application/api/user/routes.py @@ -229,7 +229,7 @@ def upload_remote(): def task_status(): """Get celery job status.""" task_id = request.args.get("task_id") - from application.celery import celery + from application.celery_init import celery task = celery.AsyncResult(task_id) task_meta = task.info diff --git a/application/api/user/tasks.py b/application/api/user/tasks.py index 4602bf85..862b6dcd 100644 --- a/application/api/user/tasks.py +++ b/application/api/user/tasks.py @@ -1,5 +1,5 @@ from application.worker import ingest_worker, remote_worker -from application.celery import celery +from application.celery_init import celery @celery.task(bind=True) def ingest(self, directory, formats, name_job, filename, user): diff --git a/application/app.py b/application/app.py index e646ffbe..fe8efd12 100644 --- a/application/app.py +++ b/application/app.py @@ -1,6 +1,6 @@ import platform import dotenv -from application.celery import celery +from application.celery_init import celery from flask import Flask, request, redirect from application.core.settings import settings from application.api.user.routes import user diff --git a/application/celery.py b/application/celery_init.py similarity index 100% rename from application/celery.py rename to application/celery_init.py diff --git a/tests/test_celery.py b/tests/test_celery.py index f4b22448..8237d136 100644 --- a/tests/test_celery.py +++ b/tests/test_celery.py @@ -1,6 +1,6 @@ from unittest.mock import patch from application.core.settings import settings -from application.celery import make_celery +from application.celery_init import make_celery @patch('application.celery.Celery')