-
Notifications
You must be signed in to change notification settings - Fork 189
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
Cronjob is run every time runcrons is called #99
Comments
I have the same problem. I didn't use this library before version 0.5.0 so I cannot say if it has something to do with the upgrade... Even worse, this behavior was only seen on the production environment. On out staging environment it seemed to work. The staging and prod environment use the same libraries and dependencies, so this is really strange... |
Have you verified that as soon as a job starts, an entry appears in the log table? |
When I was viewing the log table, after about 10 minutes of the deploy, there were multiple entries of the same job in there. Each one had a start time of 1 minute apart. Then when I restarted the application the job got started multiple times again, as I could verify via the Sorry that I cannot be more specific. But the behaviour forced me to make some emergency adjustments after the deploy. |
@DanEEStar and @sulami the only difference I could see between the two envs and versions would be in how we get the time now:
What is your timezone and is it USE_TZ? I think I know how to fix, but want to make sure. Could you locally be working in different timezones between env settings? Thanks for the info |
I don't have access to the environment in question anymore, but we did use |
Hi, i have the same issue but the provided fix didn't solve it. By looking at the code it seems that the CronJobLog record doesn't get inserted to the database until the job finishes. I've made a quick fix to CronJobManager.run by adding: And it works!! :) |
fix for issue #99. Cronjob is run every time runcrons is called
fix for issue #99. Cronjob is run every time runcrons is called
We just noticed some strange behaviour on our staging server after updating from django-cron 0.4.6 to 0.5.0. One of our jobs looks like this:
It's supposed to report on gathered analytics data once a day, basically just collecting and sending out some emails. Real cron is calling
runcrons
every minute. After experiencing some heavy load and unexpected behaviour, we could confirm thatdo_stuff()
is actually executed every minute, leading to several critical issues including zombie processes.The text was updated successfully, but these errors were encountered: