updated worker logic

This commit is contained in:
nvrl committed 2026-03-19 19:13:30 +01:00
1 parent eb2141c5af
commit 553c2a1707
2 files changed
+18 -17

No files matched your search

+1 -1
View File
@@ -23,7 +23,7 @@ class Command(BaseCommand):
# or those where next_run has passed.
now = timezone.now()
jobs_to_run = Job.objects.filter(
status__in=['pending', 'failed']
~models.Q(status='running')
).filter(
# Run if pending OR (next_run is set AND has passed)
models.Q(status='pending') |