From 67372c907d01c2d2f3cdfb579147ffa43d6d7952 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20L=C3=A9ger?= Date: Wed, 2 Oct 2019 15:58:13 -0400 Subject: [PATCH] Disabled periodic task by default --- kobo/settings/base.py | 16 ++++++++++------ kpi/tasks.py | 6 +++--- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/kobo/settings/base.py b/kobo/settings/base.py index 7a143a6cb2..c586760813 100644 --- a/kobo/settings/base.py +++ b/kobo/settings/base.py @@ -445,25 +445,29 @@ def __init__(self, *args, **kwargs): 'send-hooks-failures-reports': { 'task': 'kobo.apps.hook.tasks.failures_reports', 'schedule': crontab(hour=0, minute=0), - 'options': {'queue': 'kpi_queue'} + 'options': {'queue': 'kpi_queue'}, + 'enabled': False, }, # Schedule every Saturday at 4:00 AM UTC. Can be customized in admin section 'remove-s3-orphans': { 'task': 'kpi.tasks.remove_s3_orphans', 'schedule': crontab(hour=4, minute=0, day_of_week=6), - 'options': {'queue': 'kpi_queue'} + 'options': {'queue': 'kpi_queue'}, + 'enabled': False, }, # Schedule every Friday at 4:00 AM UTC. Can be customized in admin section - 'delete-asset-snapshots': { + 'remove-asset-snapshots': { 'task': 'kpi.tasks.remove_asset_snapshots', 'schedule': crontab(hour=4, minute=0, day_of_week=5), - 'options': {'queue': 'kpi_queue'} + 'options': {'queue': 'kpi_queue'}, + 'enabled': False, }, # Schedule every Friday at 5:00 AM UTC. Can be customized in admin section - 'delete-import-tasks': { + 'remove-import-tasks': { 'task': 'kpi.tasks.remove_import_tasks', 'schedule': crontab(hour=5, minute=0, day_of_week=5), - 'options': {'queue': 'kpi_queue'} + 'options': {'queue': 'kpi_queue'}, + 'enabled': False, }, } diff --git a/kpi/tasks.py b/kpi/tasks.py index 9a4ae96362..ce652ced90 100644 --- a/kpi/tasks.py +++ b/kpi/tasks.py @@ -38,18 +38,18 @@ def import_survey_drafts_from_dkobo(**kwargs): @shared_task -@lock(key='remove_s3_orphans', timeout=60) +@lock(key='remove_s3_orphans', timeout=3600) def remove_s3_orphans(): call_command('remove_s3_orphans') @shared_task -@lock(key='remove_asset_snapshots', timeout=60) +@lock(key='remove_asset_snapshots', timeout=3600) def remove_asset_snapshots(): call_command('remove_asset_snapshots') @shared_task -@lock(key='remove_import_tasks', timeout=60) +@lock(key='remove_import_tasks', timeout=3600) def remove_import_tasks(): call_command('remove_import_tasks')