Skip to content

Commit b828685

Browse files
committed
Remove migrated celery tasks
1 parent 1c4506d commit b828685

5 files changed

Lines changed: 2 additions & 48 deletions

File tree

app/grandchallenge/core/tasks.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import boto3
44
from django.conf import settings
55
from django.contrib.sites.models import Site
6-
from django.db import transaction
76
from django.db.models import Count
87
from django.utils import timezone
98
from django.utils.timezone import now
@@ -17,18 +16,10 @@
1716
PostProcessImageTask,
1817
RawImageUploadSession,
1918
)
20-
from grandchallenge.core.celery import acks_late_micro_short_task
2119
from grandchallenge.evaluation.models import Evaluation, Method
2220
from grandchallenge.workstations.models import Session
2321

2422

25-
@acks_late_micro_short_task(name=f"{__name__}.cleanup_celery_backend")
26-
@transaction.atomic
27-
def cleanup_celery_backend_celery():
28-
# TODO: 4408 Remove, this is still here to handle existing tasks on SQS
29-
return cleanup_celery_backend()
30-
31-
3223
@lambda_task
3324
def cleanup_celery_backend():
3425
"""Cleanup the Celery backend."""

app/grandchallenge/direct_messages/tasks.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from django.db.models import Count, F, Q
44
from lambda_tasks.decorators import lambda_task
55

6-
from grandchallenge.core.celery import acks_late_micro_short_task
76
from grandchallenge.profiles.models import NotificationEmailOptions
87

98

@@ -48,14 +47,6 @@ def get_new_senders(*, user):
4847
return sorted(list(new_senders), key=lambda s: s.pk)
4948

5049

51-
@acks_late_micro_short_task(
52-
name=f"{__name__}.send_new_unread_direct_messages_emails"
53-
)
54-
def send_new_unread_direct_messages_emails_celery():
55-
# TODO: 4408 Remove, this is still here to handle existing tasks on SQS
56-
return send_new_unread_direct_messages_emails()
57-
58-
5950
@lambda_task
6051
def send_new_unread_direct_messages_emails():
6152
site = Site.objects.get_current()

app/grandchallenge/discussion_forums/tasks.py

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,16 @@
11
from uuid import UUID
22

33
from actstream.actions import follow
4-
from celery.utils.log import get_task_logger
54
from django.apps import apps
6-
from django.db import transaction
75
from lambda_tasks.decorators import lambda_task
6+
from lambda_tasks.logging import task_logger
87

9-
from grandchallenge.core.celery import acks_late_micro_short_task
108
from grandchallenge.core.exceptions import LockNotAcquiredException
119
from grandchallenge.notifications.models import (
1210
Notification,
1311
NotificationTypeChoices,
1412
)
1513

16-
logger = get_task_logger(__name__)
17-
18-
19-
@acks_late_micro_short_task(
20-
name=f"{__name__}.create_forum_notifications",
21-
retry_on=(LockNotAcquiredException,),
22-
)
23-
@transaction.atomic
24-
def create_forum_notifications_celery(**kwargs):
25-
# TODO: 4408 Remove, this is still here to handle existing tasks on SQS
26-
return create_forum_notifications(**kwargs)
27-
2814

2915
@lambda_task(retry_on=(LockNotAcquiredException,))
3016
def create_forum_notifications(
@@ -39,7 +25,7 @@ def create_forum_notifications(
3925
model = apps.get_model(app_label=app_label, model_name=model_name)
4026

4127
if model not in (ForumPost, ForumTopic):
42-
logger.error(
28+
task_logger.error(
4329
f"Forum notifications can only be created for posts or topics, not for {model}"
4430
)
4531
return

app/grandchallenge/notifications/tasks.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,12 @@
22
from django.db.models import Count, F, Q
33
from lambda_tasks.decorators import lambda_task
44

5-
from grandchallenge.core.celery import acks_late_micro_short_task
65
from grandchallenge.profiles.models import (
76
NotificationEmailOptions,
87
UserProfile,
98
)
109

1110

12-
@acks_late_micro_short_task(name=f"{__name__}.send_unread_notification_emails")
13-
def send_unread_notification_emails_celery():
14-
# TODO: 4408 Remove, this is still here to handle existing tasks on SQS
15-
return send_unread_notification_emails()
16-
17-
1811
@lambda_task
1912
def send_unread_notification_emails():
2013
site = Site.objects.get_current()

app/grandchallenge/statistics/tasks.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
from grandchallenge.cases.models import Image, ImageFile
1616
from grandchallenge.challenges.models import Challenge
1717
from grandchallenge.components.models import ComponentInterfaceValue
18-
from grandchallenge.core.celery import acks_late_micro_short_task
1918
from grandchallenge.evaluation.models import (
2019
EvaluationGroundTruth,
2120
Method,
@@ -30,12 +29,6 @@
3029
from grandchallenge.workstations.models import Session, WorkstationImage
3130

3231

33-
@acks_late_micro_short_task(name=f"{__name__}.update_site_statistics_cache")
34-
def update_site_statistics_cache_celery():
35-
# TODO: 4408 Remove, this is still here to handle existing tasks on SQS
36-
return update_site_statistics_cache()
37-
38-
3932
@lambda_task
4033
def update_site_statistics_cache():
4134
public_challenges = Challenge.objects.filter(hidden=False)

0 commit comments

Comments
 (0)