Tivix / django-cron

Write cron business logic as a Python class and let this app do the rest! It enables Django projects to schedule cron tasks, tracks their success / failures, manages contention (via a cache) etc. Basically takes care of all the boring work for you :-)
www.tivix.com
MIT License
900 stars 193 forks source link

In doubt #60

Closed marcussaad closed 9 years ago

marcussaad commented 9 years ago

First of all, thanks for this app/project, it will be really helpful to me.

One thing that is making me confused is the fact that I'm able to define run_every_min or run_at and later at the docs it says that I'll need to setup a cronjob for it.

So, defining those values works only like an if? In case I set it to run_every_min to 60, and set my cronjob to run every 60 minutes as well, what will that parameter do ?

craiglabenz commented 9 years ago

I would set your cron job to run every minute. It should only invoke the django-cron management command (./manage.py runcrons, if memory serves). Once that command starts, it will honor your run_every_min or run_at configuration by comparing the current time against the last known job runtime.

maciej-jaworski commented 9 years ago

As mentioned above, runcrons should be set to run fairly frequently (docs recommend 5 minutes), the command itself will check if any of cronjobs you defined need to be run.

See relevant section of docs here: http://django-cron.readthedocs.org/en/latest/installation.html

marcussaad commented 9 years ago

@craiglabenz and @mjaworski, thanks for those clarifications.