11from uuid import UUID
22
33from actstream .actions import follow
4- from celery .utils .log import get_task_logger
54from django .apps import apps
6- from django .db import transaction
75from 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
108from grandchallenge .core .exceptions import LockNotAcquiredException
119from 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 ,))
3016def 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
0 commit comments