Skip to content Skip to sidebar Skip to footer

Preventing Multiple Executions

I have this Django cron job script (I am using kronos for that, which is great). Since I trigger this job every minute, I want to make sure that there isn't another instance of th

Solution 1:

There's a Django app here: https://github.com/jsocol/django-cronjobs

Also available on pip as cronjobs.

Just in case you go straight to pip; You register jobs using the decorator like so:

# myapp/cron.pyimport cronjobs

@cronjobs.registerdefperiodic_task():
    pass

Then run the command via:

$ ./manage.py cron periodic_task

It has job locking by default but you can disable it when you apply the decorator:

@register(lock=False)

Post a Comment for "Preventing Multiple Executions"