Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch_up States #110

Closed
eddiezab opened this issue Nov 6, 2015 · 5 comments
Closed

Catch_up States #110

eddiezab opened this issue Nov 6, 2015 · 5 comments

Comments

@eddiezab
Copy link

eddiezab commented Nov 6, 2015

I would like to see the option to catch up from missed tasks to 3 states instead of 2. The states would be:

None: Same effect as current boolean False
Once: Instead of all missed occurrences, this just executes the missed task(s) one time.
All: Same effect as current boolean True

@Koed00
Copy link
Owner

Koed00 commented Nov 7, 2015

The current behavior for catch_up: False is to execute the missed task and then set the next schedule past the present date instead of in the past. Which is what you describe as 'once', since it's impossible to have multiple missed schedules of the same task. Maybe this is not entirely clear from the documentation.
.

@eddiezab
Copy link
Author

eddiezab commented Nov 7, 2015

Thanks for the clarification. I think what threw me off was this statement:

Any hourly schedules you had will run 24 times, once every schedule loop, until they are back in sync

found in the Missed schedules section of this page: https://django-q.readthedocs.org/en/latest/schedules.html

@Koed00
Copy link
Owner

Koed00 commented Nov 7, 2015

Some of it I wrote in a hurry ;) I'll see if I can make it a little clearer.

What happens in the code by default is this:

  • find a task with a scheduled time in the past
  • run it
  • add the schedule type to original scheduled time ( i.e. 1 hour or 1 day etc)
  • save the new scheduled time

So if the schedule was 24 hours behind, it will be rescheduled to 23 hours behind.
Which effectively runs immediately, since it's in the past too. This keeps happening until the scheduled time is in the future.

Setting catch_up to False, modifies the save step to loop back to the add 1 hour (or 1 day etc) until the new scheduled time is in the future before it saves it.

This way you always preserve the original run time, day of the week etc of the schedule.

@Koed00
Copy link
Owner

Koed00 commented Nov 8, 2015

Does #112 make it a little clearer?

@eddiezab
Copy link
Author

eddiezab commented Nov 8, 2015

I think so. Thank you a again for the clarification! I'm looking forward to
integrating this with my project.

On Sun, Nov 8, 2015 at 4:45 AM Ilan Steemers notifications@github.com
wrote:

Does #112 #112 make it a little
clearer?


Reply to this email directly or view it on GitHub
#110 (comment).

@Koed00 Koed00 closed this as completed Nov 8, 2015
panhaoyu pushed a commit to panhaoyu/django-q that referenced this issue Sep 16, 2023
* Correct health check import in examples.rst

* Update monitor.rst

---------

Co-authored-by: Stan Triepels <1939656+GDay@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants