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:
@@ -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')
|
||||
|
Reference in New Issue
Block a user