-
Notifications
You must be signed in to change notification settings - Fork 184
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
Cron skips minutes #232
Comments
I encountered the same problem, the problem is that the start_time and end_time columns contain seconds, this needs to be removed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello. We have multiple crons running every minute. They are used for email notifications. User chooses recipients and the time he wants recipients to be notified (10:25 for example). During testing on out server we've noticed that some minutes were skipped. That was unexpected because we wrapped each of our function in django_q async_task. For example:
The crontab was not the problem either. It was set as follows
* * * * * /path_to/venv/bin/python3 /path_to/manage.py runcrons
I tried to reproduce the issue locally and created custom command.
Result was very similar to that we have seen on our server. I tried
time.sleep(59)
it didn't help. After some time trying to solve the problem, eventually, I settime.sleep(59)
and made some changes to CronJobManager's__enter__
methodIt worked locally. It seems that you shouldn't track start_time in seconds when possible minimum of crontab and your library is one minute.
I haven't used it on the server yet because every time, I need to make sure we have these changes implemented. We might simply forget to make changes to the library. I'm not sure if adding it to Git is a good option. I really hope you could modify the library so that every team can simply use 'pip install'.
It is also necessary to correct
humanize_duration
if you will use suggested changes.The text was updated successfully, but these errors were encountered: