Added support for periodic Celery tasks.

You have to run "manage.py celery beat" for this to work too. Run
"manage.py celery beat -- --help" to get CLI option help.
This commit is contained in:
2017-09-14 16:00:59 +02:00
parent 5d137ac997
commit 82d2921424
3 changed files with 26 additions and 0 deletions

View File

@@ -58,3 +58,12 @@ def purge():
log.warning('Purging all pending Celery tasks.')
current_app.celery.control.purge()
@manager_celery.option('args', nargs='*')
def beat(args):
"""Runs the Celery beat."""
from celery.bin.beat import beat
return beat(app=current_app.celery).run_from_argv('je moeder', args, command='beat')