schedule form and helpers

Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
This commit is contained in:
Marc 'risson' Schmitt
2025-04-03 16:51:24 +02:00
parent c92cbd7e22
commit c62f73400a
9 changed files with 223 additions and 7 deletions

View File

@ -40,7 +40,9 @@ class Scheduler:
tenant=tenant.schema_name,
)
with transaction.atomic(using=router.db_for_write(Schedule)):
for schedule in Schedule.objects.select_for_update().filter(next_run__lt=now()):
for schedule in Schedule.objects.select_for_update().filter(
next_run__lt=now(), paused=False
):
self.process_schedule(schedule)
def run(self):