diff --git a/cds/modules/flows/tasks.py b/cds/modules/flows/tasks.py index 074fc4bf9..eaa97952a 100644 --- a/cds/modules/flows/tasks.py +++ b/cds/modules/flows/tasks.py @@ -36,7 +36,6 @@ from celery import shared_task from celery.result import AsyncResult from celery.utils.log import get_task_logger -from celery.worker.control import revoke from flask import current_app # from flask_iiif.utils import create_gif_from_frames @@ -154,7 +153,7 @@ def on_success(self, retval, task_id, args, kwargs): @staticmethod def stop_task(celery_task_id): """Stop singular task.""" - revoke(str(celery_task_id), terminate=True, signal="SIGKILL") + celery_app.control.revoke(str(celery_task_id), terminate=True, signal="SIGKILL") result = AsyncResult(str(celery_task_id)) result.forget()