From a4e22b4f417efe1e100baed0b3603ecb4155367e Mon Sep 17 00:00:00 2001 From: davelopez <46503462+davelopez@users.noreply.github.com> Date: Thu, 4 Apr 2024 18:40:11 +0200 Subject: [PATCH] Add celery task to dispatch pending notifications --- lib/galaxy/celery/tasks.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/galaxy/celery/tasks.py b/lib/galaxy/celery/tasks.py index 3478f7d2e94..acc65a593c0 100644 --- a/lib/galaxy/celery/tasks.py +++ b/lib/galaxy/celery/tasks.py @@ -494,3 +494,11 @@ def send_notification_to_recipients_async( _, notifications_sent = notification_manager.send_notification_to_recipients(request=request) log.info(f"Successfully sent {notifications_sent} notifications.") + + +@galaxy_task(action="dispatch pending notifications") +def dispatch_pending_notifications(notification_manager: NotificationManager): + """Dispatch pending notifications.""" + count = notification_manager.dispatch_pending_notifications_via_channels() + if count: + log.info(f"Successfully dispatched {count} notifications.")