SIENTIAPDE-1174

feat: enhance notification filtering in Formatters and SlotManager classes

- Added logic to remove receiver groups with no notifications, improving the efficiency of notification handling.
- Implemented early return in Alerts and Reports workflows when there are no notifications or receiver groups, streamlining the processing flow.
This commit is contained in:
vitor-aignosi
2025-08-01 12:41:40 -03:00
parent ae0fa2fc8a
commit 6c1b7c4bf7
4 changed files with 20 additions and 0 deletions

View File

@@ -574,4 +574,11 @@ class Formatters(BaseActivity):
notification)
already_added_keys.append(key)
# Remove groups with no notifications
receiver_groups = {
group_name: group
for group_name, group in receiver_groups.items()
if group['notifications']
}
return receiver_groups

View File

@@ -318,6 +318,13 @@ class SlotManager(Redis):
notification)
already_added_keys.append(key)
# Remove groups with no notifications
receiver_groups = {
group_name: group
for group_name, group in receiver_groups.items()
if group['notifications']
}
return receiver_groups
@activity.defn(name="store_notification_cache")