mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-09 06:18:11 +08:00
Allow tasks to be scheduled on a specific cluster (#555)
* Allows schedule by cluster * Update docs * Add example in doc * Fixes cluster field must be blank * Adds cluster arg to schedule func * Adds cluster field in list_display/filter for admin * Uses Q filter to fetch schedule * Fixes ref in doc * Adds tests
This commit is contained in:
@@ -578,6 +578,7 @@ def scheduler(broker: Broker = None):
|
||||
Schedule.objects.select_for_update()
|
||||
.exclude(repeats=0)
|
||||
.filter(next_run__lt=timezone.now())
|
||||
.filter(db.models.Q(cluster__isnull=True) | db.models.Q(cluster=Conf.PREFIX))
|
||||
):
|
||||
args = ()
|
||||
kwargs = {}
|
||||
|
||||
Reference in New Issue
Block a user