diff --git a/orchestrator/activities/formatters.py b/orchestrator/activities/formatters.py index 17a091b..1ebcc6b 100644 --- a/orchestrator/activities/formatters.py +++ b/orchestrator/activities/formatters.py @@ -558,15 +558,20 @@ class Formatters(BaseActivity): } receiver_groups[group_name]['notifications'] = [] + already_added_keys = [] + ignore_list = receiver_group.get('ignore', []) for notification in notification_package: alert_type = "reports" notification_id = notification['notification_id'] + key = f"{notification['trigger']}:{notification_id}" + # Check if this group must be notified - if alert_type in receiver_group['contents'] and notification_id not in ignore_list: + if alert_type in receiver_group['contents'] and notification_id not in ignore_list and key not in already_added_keys: receiver_groups[group_name]["notifications"].append( notification) + already_added_keys.append(key) return receiver_groups diff --git a/orchestrator/activities/slot_manager.py b/orchestrator/activities/slot_manager.py index 16cf26f..076a1a8 100644 --- a/orchestrator/activities/slot_manager.py +++ b/orchestrator/activities/slot_manager.py @@ -289,6 +289,8 @@ class SlotManager(Redis): } receiver_groups[group_name]['notifications'] = [] + already_added_keys = [] + ignore_list = receiver_group.get('ignore', []) for notification in notification_package: @@ -311,9 +313,10 @@ class SlotManager(Redis): alert_type = "persistent_alerts" # Check if this group must be notified - if alert_type in receiver_group['contents'] and notification_id not in ignore_list: + if alert_type in receiver_group['contents'] and notification_id not in ignore_list and key not in already_added_keys: receiver_groups[group_name]["notifications"].append( notification) + already_added_keys.append(key) return receiver_groups