From 5e02943a77cdfd8c3d5c2dc2dd352966a4e17a90 Mon Sep 17 00:00:00 2001 From: rogersun Date: Mon, 20 Apr 2026 17:59:55 +0800 Subject: [PATCH] =?UTF-8?q?celery=E5=A2=9E=E5=8A=A0=E7=BA=BF=E7=A8=8B?= =?UTF-8?q?=E9=94=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dingxin_toolbox_drf/celery.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dingxin_toolbox_drf/celery.py b/dingxin_toolbox_drf/celery.py index 50ddf56..9415148 100644 --- a/dingxin_toolbox_drf/celery.py +++ b/dingxin_toolbox_drf/celery.py @@ -14,6 +14,10 @@ app.config_from_object('django.conf:settings', namespace='CELERY') # 自动发现并添加任务 app.autodiscover_tasks() +# 强制单实例运行 +app.conf.worker_prefetch_multiplier=1 +app.conf.task_acks_late=True + # app.conf.beat_schedule = { # 'update_client_task': { # 'task': 'update.tasks.update_client',