From a51549cf1c2de22f04b2bb56bc3467f4ae0371bb Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Wed, 20 Sep 2023 15:30:29 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20ansible=E4=BB=BB=E5=8A=A1=20=E6=9C=AA?= =?UTF-8?q?=E6=BF=80=E6=B4=BB=E7=9A=84=E6=97=B6=E5=80=99=E5=85=B3=E9=97=AD?= =?UTF-8?q?=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1=20(#11631)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: feng <1304903146@qq.com> --- apps/ops/mixin.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/ops/mixin.py b/apps/ops/mixin.py index 05d1e297d..549e422ee 100644 --- a/apps/ops/mixin.py +++ b/apps/ops/mixin.py @@ -48,7 +48,8 @@ class PeriodTaskModelMixin(models.Model): def set_period_schedule(self): name, task, args, kwargs = self.get_register_task() - if not self.is_periodic: + is_active = self.is_active if hasattr(self, 'is_active') else True + if not self.is_periodic or not is_active: disable_celery_periodic_task(name) return