Tivix / django-cron

Write cron business logic as a Python class and let this app do the rest! It enables Django projects to schedule cron tasks, tracks their success / failures, manages contention (via a cache) etc. Basically takes care of all the boring work for you :-)
www.tivix.com
MIT License
900 stars 193 forks source link

django_cron stops working if date will be (temporary, by error, etc) in future. #80

Closed belonesox closed 2 years ago

belonesox commented 8 years ago

Consider the case:

Then, accorging to CronJobManager.should_run_now … last_job = CronJobLog.objects.filter(code=cron_job.code).latest('start_time') … if get_current_time() > last_job.start_time + timedelta(minutes=cron_job.schedule.retry_after_failure_mins): …

Django_cron stop working until this future is back.

:(

IMHO, when determining last_job, django_cron should filter/ignore jobs with future dates.

JedrzejMaluszczak commented 2 years ago

Done.