Closed akashpatni closed 7 years ago
I have exactly same problem. If anyone can solutions. Please let me know it.
This will make your task execute every time you call manage.py runcrons:
schedule = Schedule(run_every_mins=0)
And if you want it to be executed every minute put 1 instead of 0.
Setting run_every_mins=1 is error-prone: Consider that the crontab has us run every minute. If there is a slight difference in time offset on each run, the job might not be executed. Say the crontab executes at 08:00:00.02 and then at 08:01:00.01; there is less than a full minute between these timestamps, so django-cron passes on letting the job execute.
@akashpatni see documentation:
- Now everytime you run the management command python manage.py runcrons all the crons will run if required. Depending on the application the management command can be called from the Unix crontab as often as required. Every 5 minutes usually works for most of my applications, for example:
This is intended functionality
having the same issue. When I write "python manage.py runcrons", it works well for first time. But it wont run every minute. Help!
@sankethsj use python manage.py cronloop
instead.
You need to update django-cron to version 0.6.0
Hi,
I have used django-cron for setting up cron task for my project and I am able to run the scripts manually with command python manage.py runcrons and it is running for only one time. Now I want to run script for every minute and for that I have to use crontab -e and I have done in the same way as told in documentation but with no success.
Can you please help me on that