Comments (6)
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.
That way the query in CronJobManager.should_run_now wont find the job that is already running and start the job again before the first one finishes.
I've made a quick fix to CronJobManager.run by adding:
self.make_log('Job Running!!', success=True)
Just before the line:
self.msg = self.cron_job.do()
And it works!! :)
from django-cron.
I have the same problem.
A job which should run once a day, configured via run_at_times
seems to run every minute.
Python processes are started every minute and get never killed.
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...
from django-cron.
Have you verified that as soon as a job starts, an entry appears in the log table?
from django-cron.
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 I killed all python processes. I also delete all entries in the job table.
Then when I restarted the application the job got started multiple times again, as I could verify via the ps
command on the server. But it did not create new entries in the job table. The job table remained empty this time...
Sorry that I cannot be more specific. But the behaviour forced me to make some emergency adjustments after the deploy.
I can try it again, when I have more time.
from django-cron.
@DanEEStar and @sulami the only difference I could see between the two envs and versions would be in how we get the time now:
def get_current_time():
now = utc_now()
return now if is_naive(now) else localtime(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
from django-cron.
I don't have access to the environment in question anymore, but we did use USE_TZ
, and I'm pretty sure the servers were in Ireland (AWS).
from django-cron.
Related Issues (20)
- New version release? HOT 1
- `django.utils.translation.ugettext_lazy` is deprecated and will be removed in 4.0 HOT 1
- Wrong depreciation message in README HOT 2
- Maintained or not maintained - that's the question. HOT 1
- Settinng up on docker alpine image
- Is this project deprecated or maintained? HOT 10
- Run monthly HOT 2
- File lock backend doesn't lock
- CronJobBase is running twice while running cron job every minute
- documentation still at version 0.51
- Duplicate runs using default cache lock
- Cron skips minutes HOT 1
- Issue with run_at_times HOT 1
- Pending migrations
- add license in setup.py for pip-license parser
- Add --slient flag to cronloop command.
- get_time_until_run in core.py gives an error
- Error with run weekly feature HOT 2
- Error with database cron job locks HOT 2
- Error after upgrade to 0.6.0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-cron.