Skip to content

Commit

Permalink
Merge pull request #1221 Remove periodic task scheduling
Browse files Browse the repository at this point in the history
  • Loading branch information
ukanga authored Jan 30, 2018
2 parents a24229e + f8c8ec8 commit 674a2f6
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions onadata/apps/viewer/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from datetime import timedelta

from celery import task
from celery.task.schedules import crontab
from django.conf import settings
from django.shortcuts import get_object_or_404
from django.utils import timezone
Expand Down Expand Up @@ -355,10 +354,7 @@ def delete_export(export_id):
return False


@task.periodic_task(
run_every=(crontab(hour='*/7')),
ignore_result=True
)
@task(ignore_result=True)
def mark_expired_pending_exports_as_failed():
"""
Exports that have not completed within a set time should be marked as
Expand All @@ -371,10 +367,7 @@ def mark_expired_pending_exports_as_failed():
exports.update(internal_status=Export.FAILED)


@task.periodic_task(
run_every=(crontab(hour='*/7')),
ignore_result=True
)
@task(ignore_result=True)
def delete_expired_failed_exports():
"""
Delete old failed exports
Expand Down

0 comments on commit 674a2f6

Please sign in to comment.