Skip to content

Commit cdd5eb6

Browse files
committed
Use @app.task instead of @shared_task
Previously, `@shared_task` was preferred by Resonant, but I realized that `@app.task` will be able to provide better typechecking. `@shared_task` is essential only for reusable apps (and `core` isn't reusable). I'll make an upstream change to the Resonant cookiecutter to prefer `@app.task` too.
1 parent a01e626 commit cdd5eb6

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

bats_ai/core/tasks/periodic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
from celery import shared_task
21
from django.utils import timezone
32

3+
from bats_ai.celery import app
44
from bats_ai.core.models import ExportedAnnotationFile
55

66

7-
@shared_task
7+
@app.task
88
def delete_expired_exported_files():
99
now = timezone.now()
1010
expired_files = ExportedAnnotationFile.objects.filter(expires_at__lt=now)

0 commit comments

Comments
 (0)