Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
This commit is contained in:
Marc 'risson' Schmitt
2025-06-05 15:05:26 +02:00
parent 3140325493
commit e671811ad2

View File

@ -39,9 +39,11 @@ class Scheduler:
"Failed to acquire lock for tasks scheduling, skipping", "Failed to acquire lock for tasks scheduling, skipping",
tenant=tenant.schema_name, tenant=tenant.schema_name,
) )
return
with transaction.atomic(using=router.db_for_write(Schedule)): with transaction.atomic(using=router.db_for_write(Schedule)):
for schedule in Schedule.objects.select_for_update().filter( for schedule in Schedule.objects.select_for_update().filter(
next_run__lt=now(), paused=False next_run__lt=now(),
paused=False,
): ):
self.process_schedule(schedule) self.process_schedule(schedule)