You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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 set time.sleep(59) and made some changes to CronJobManager's __enter__ method
It 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:
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: