Skip to content

Commit

Permalink
Register maintenance task with Celery
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesrkiger committed May 1, 2024
1 parent 7176a72 commit 922d477
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions onadata/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -709,16 +709,22 @@ def skip_suspicious_operations(record):
CELERY_BEAT_SCHEDULE = {
# Periodically mark exports stuck in the "pending" state as "failed"
# See https://github.com/kobotoolbox/kobocat/issues/315
'log-stuck-exports-and-mark-failed': {
'task': 'onadata.apps.viewer.tasks.log_stuck_exports_and_mark_failed',
'schedule': timedelta(hours=6),
'options': {'queue': 'kobocat_queue'}
"log-stuck-exports-and-mark-failed": {
"task": "onadata.apps.viewer.tasks.log_stuck_exports_and_mark_failed",
"schedule": timedelta(hours=6),
"options": {"queue": "kobocat_queue"},
},
"delete-daily-xform-submissions-counter": {
"task": "onadata.apps.logger.tasks.delete_daily_counters",
"schedule": crontab(hour=0, minute=0),
"options": {"queue": "kobocat_queue"},
},
# Run maintenance every day at 20:00 UTC
"perform-maintenance": {
"task": "onadata.apps.logger.tasks.perform_maintenance",
"schedule": crontab(hour=20, minute=0),
"options": {"queue": "kobocat_queue"},
},
'delete-daily-xform-submissions-counter': {
'task': 'onadata.apps.logger.tasks.delete_daily_counters',
'schedule': crontab(hour=0, minute=0),
'options': {'queue': 'kobocat_queue'}
}
}

CELERY_TASK_DEFAULT_QUEUE = "kobocat_queue"
Expand Down

0 comments on commit 922d477

Please sign in to comment.