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:
@@ -465,6 +465,13 @@ class PillarServer(Eve):
|
||||
result_expires=3600,
|
||||
)
|
||||
|
||||
# This configures the Celery task scheduler in such a way that we don't
|
||||
# have to import the pillar.celery.XXX modules. Remember to run
|
||||
# 'manage.py celery beat' too, otherwise those will never run.
|
||||
beat_schedule = self.config.get('CELERY_BEAT_SCHEDULE')
|
||||
if beat_schedule:
|
||||
self.celery.conf.beat_schedule = beat_schedule
|
||||
|
||||
self.log.info('Pinging Celery workers')
|
||||
self.log.info('Response: %s', self.celery.control.ping())
|
||||
|
||||
|
Reference in New Issue
Block a user