summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Tanous <etanous@nvidia.com>2024-11-27 15:46:16 +0300
committerEd Tanous <ed@tanous.net>2024-11-27 23:32:56 +0300
commit3433b03a331fca73238e93831422ca8abbab5c7d (patch)
tree3ea23c10ddc7ea034822bcf852aab473cd521a98
parentea20bc6610b4e8cbd2b143221b2917c5e6cf18b6 (diff)
downloadbmcweb-3433b03a331fca73238e93831422ca8abbab5c7d.tar.xz
Break out SendEventToSubs
Breaking out this small function allows for rolling large parts of this class into an RAII class in the next patch. Tested: In the next patch. Change-Id: I66916dcfd716f994913ff6f283e231b8933bdc99 Signed-off-by: Ed Tanous <etanous@nvidia.com>
-rw-r--r--redfish-core/include/event_service_manager.hpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/redfish-core/include/event_service_manager.hpp b/redfish-core/include/event_service_manager.hpp
index 4197cda72d..37d047e63e 100644
--- a/redfish-core/include/event_service_manager.hpp
+++ b/redfish-core/include/event_service_manager.hpp
@@ -558,6 +558,17 @@ class EventServiceManager
return true;
}
+ static void
+ sendEventsToSubs(const std::vector<EventLogObjectsType>& eventRecords)
+ {
+ for (const auto& it :
+ EventServiceManager::getInstance().subscriptionsMap)
+ {
+ Subscription& entry = *it.second;
+ entry.filterAndSendEventLogs(eventRecords);
+ }
+ }
+
static void sendTelemetryReportToSubs(
const std::string& reportId, const telemetry::TimestampReadings& var)
{
@@ -704,15 +715,7 @@ class EventServiceManager
BMCWEB_LOG_DEBUG("No log entries available to be transferred.");
return;
}
-
- for (const auto& it : subscriptionsMap)
- {
- std::shared_ptr<Subscription> entry = it.second;
- if (entry->userSub->eventFormatType == "Event")
- {
- entry->filterAndSendEventLogs(eventRecords);
- }
- }
+ EventServiceManager::sendEventsToSubs(eventRecords);
}
};