mirror of
https://github.com/jumpserver/jumpserver.git
synced 2026-04-04 19:32:41 +00:00
perf: ansible任务 未激活的时候关闭定时任务 (#11631)
Co-authored-by: feng <1304903146@qq.com>
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user