From a891692b71307794897821f784b6a43fa423ac35 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Wed, 13 Mar 2024 17:37:46 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20base=20=E6=8F=90=E4=BE=9B=E7=9B=91?= =?UTF-8?q?=E6=B5=8Bcelery=E7=9A=84=E5=AE=9E=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/celery.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/celery.py b/server/celery.py index 747a08bb..4081020e 100755 --- a/server/celery.py +++ b/server/celery.py @@ -1,6 +1,7 @@ import os from . import conf from celery import Celery +from celery.app.control import Control, Inspect # set the default Django settings module for the 'celery' program. os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'server.settings') @@ -16,6 +17,9 @@ app.config_from_object('django.conf:settings', namespace='CELERY') # Load task modules from all registered Django app configs. app.autodiscover_tasks() +celery_control: Control = Control(app=app) +celery_inspect: Inspect = celery_control.inspect() + @app.task(bind=True) def debug_task(self):