mirror of
https://github.com/django-q2/django-q2.git
synced 2026-09-15 13:37:56 +08:00
* Comment out decrement of s.repeats in scheduler to fix negative repeat count issue * Fix repeat count handling in scheduler - Reset `repeats` to -1 for values less than -1 - Decrement `repeats` by 1 if it's greater than 0
This commit is contained in:
@@ -82,7 +82,15 @@ def scheduler(broker: Broker = None):
|
||||
break
|
||||
|
||||
s.next_run = next_run
|
||||
s.repeats += -1
|
||||
|
||||
# Little Fix for already broken numbers
|
||||
if s.repeats < -1:
|
||||
s.repeats = -1
|
||||
|
||||
# Check if the value is not zero
|
||||
if s.repeats > 0:
|
||||
s.repeats -= 1
|
||||
|
||||
# send it to the cluster; any cluster name is allowed in multi-queue scenarios
|
||||
# because `broker_name` is confusing, using `cluster` name is recommended and takes precedence
|
||||
q_options["cluster"] = s.cluster or q_options.get(
|
||||
|
||||
Reference in New Issue
Block a user