From 296bb888343ee8260e95785f5491e56d5c64e49c Mon Sep 17 00:00:00 2001 From: Bai Date: Fri, 12 Mar 2021 14:09:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9celery=E5=81=A5?= =?UTF-8?q?=E5=BA=B7=E6=A3=80=E6=B5=8Bworker=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/ops/celery/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/ops/celery/utils.py b/apps/ops/celery/utils.py index 41f99212f..ed51dc964 100644 --- a/apps/ops/celery/utils.py +++ b/apps/ops/celery/utils.py @@ -112,7 +112,8 @@ def get_celery_status(): ping_data = i.ping() or {} active_nodes = [k for k, v in ping_data.items() if v.get('ok') == 'pong'] active_queue_worker = set([n.split('@')[0] for n in active_nodes if n]) - if len(active_queue_worker) < 5: + # Celery Worker 数量: 2 + if len(active_queue_worker) < 2: print("Not all celery worker worked") return False else: