Skip to content

Commit

Permalink
Disabled periodic task by default
Browse files Browse the repository at this point in the history
  • Loading branch information
noliveleger committed Oct 2, 2019
1 parent cd50613 commit 67372c9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
16 changes: 10 additions & 6 deletions kobo/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
}

Expand Down
6 changes: 3 additions & 3 deletions kpi/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

0 comments on commit 67372c9

Please sign in to comment.