diff --git a/django_q/cluster.py b/django_q/cluster.py index b10e1462..6ad02662 100644 --- a/django_q/cluster.py +++ b/django_q/cluster.py @@ -65,11 +65,13 @@ def __init__(self, broker: Broker, event: threading.Event): self.stopped = event def run(self): - # Call once on thread start - scheduler(self.broker) - while not self.stopped.wait(60.0): - # Call thereafter every ~60s + # Only do a loop if configured to enable schedules + if Conf.SCHEDULER: + # Call once at startup scheduler(self.broker) + while not self.stopped.wait(60.0): + # Call thereafter every ~60s + scheduler(self.broker) class Cluster: