Skip to content

Commit

Permalink
Merge pull request #994 from xucailiang/fix-celery-import-error
Browse files Browse the repository at this point in the history
rename celery.py
  • Loading branch information
dartpain authored Jun 19, 2024
2 parents eae49d2 + 1754570 commit c80678a
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion application/api/user/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion application/api/user/tasks.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
2 changes: 1 addition & 1 deletion application/app.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions tests/test_celery.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
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')
@patch('application.celery_init.Celery')
def test_make_celery(mock_celery):
# Arrange
app_name = 'test_app_name'
Expand Down

0 comments on commit c80678a

Please sign in to comment.