Added new scheduled task

- runs 1 min past the hour, every hour
- looks up all scheduled jobs that have a scheduled date in the past and adds them to the normal process job queue
- these are then processed as normal
This commit is contained in:
Martyn Inglis
2016-08-24 17:03:56 +01:00
parent 1bddf66ed5
commit 2cffed9cd4
3 changed files with 79 additions and 14 deletions

View File

@@ -50,6 +50,11 @@ class Config(object):
CELERY_TASK_SERIALIZER = 'json'
CELERY_IMPORTS = ('app.celery.tasks', 'app.celery.scheduled_tasks')
CELERYBEAT_SCHEDULE = {
'run-scheduled-jobs': {
'task': 'run-scheduled-jobs',
'schedule': crontab(minutes=1),
'options': {'queue': 'periodic'}
},
'delete-verify-codes': {
'task': 'delete-verify-codes',
'schedule': timedelta(minutes=63),