django-q2
django-q2 copied to clipboard
Feature request: allow to configure `catch_up` per `Schedule` instead of being a global configuration
Setting affected
Django Q2 provides a catch_up
setting, which is global and it affects all of the Schedules, as it can be seen in the following code:
https://github.com/django-q2/django-q2/blob/v1.7.2/django_q/scheduler.py#L76-L81
Issue
Some of the tasks I am running use the next execution time and it needs to be in the future. If the cluster or workers have been stopped for some time, this task will fail when they are restarted. The workaround implemented is to do the equivalent of a "disabled catch up" in the task, i.e. calculate the next run in the future and update the Schedule.next_run
to it. There may be better workarounds.
Requested feature
Allow to configure Schedule.catch_up
and use it in the scheduler.py
when updating Schedule.next_run
, or directly implement it in Schedule.calculate_next_run
.