summaryrefslogtreecommitdiff
path: root/src/webserver_main.cpp
diff options
context:
space:
mode:
authorP Dheeraj Srujan Kumar <p.dheeraj.srujan.kumar@intel.com>2021-02-04 23:21:15 +0300
committerEd Tanous <ed@tanous.net>2021-03-12 22:09:05 +0300
commitb614e2bde68db6712228f8533f56f94e41fda624 (patch)
tree71a8b35d7ef477b4a2e952c386268d53eff38bca /src/webserver_main.cpp
parent1d40ef697d61199197214380ac01970b30d5d575 (diff)
downloadbmcweb-b614e2bde68db6712228f8533f56f94e41fda624.tar.xz
Initialize Event Service Config on bmcweb restart
Added instantiation of EventServiceManager Object to initialize Event Service Config and register the subscriptions from the config. During BMC boot, there would be many redfish events logged due to which, once bmcweb service is up, the EventServiceManager object is instantiated by getInstance method called from inotify. But, on bmcweb service restart, the getInstance method is not called untill a redfish event is logged, or untill a GET/POST/PATCH/DELETE etc. call is made to /redfish/v1/EventService route, due to which none of the Subscriptions would be functional. Hence this commit. Tested: - Subscribed Events were successfully received on restart of bmcweb Service as well as on reboot of bmc - Redfish validator passed Signed-off-by: P Dheeraj Srujan Kumar <p.dheeraj.srujan.kumar@intel.com> Change-Id: I50b6fd21a262e7b73fbf9f2ac94c1ffdacef4800
Diffstat (limited to 'src/webserver_main.cpp')
-rw-r--r--src/webserver_main.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/webserver_main.cpp b/src/webserver_main.cpp
index 014c2ff454..3b9631af40 100644
--- a/src/webserver_main.cpp
+++ b/src/webserver_main.cpp
@@ -79,6 +79,10 @@ int main(int /*argc*/, char** /*argv*/)
#ifdef BMCWEB_ENABLE_REDFISH
crow::redfish::requestRoutes(app);
+ redfish::RedfishService redfish(app);
+
+ // Create EventServiceManager instance and initialize Config
+ redfish::EventServiceManager::getInstance();
#endif
#ifdef BMCWEB_ENABLE_DBUS_REST
@@ -116,8 +120,6 @@ int main(int /*argc*/, char** /*argv*/)
crow::nbd_proxy::requestRoutes(app);
#endif
- redfish::RedfishService redfish(app);
-
#ifndef BMCWEB_ENABLE_REDFISH_DBUS_LOG_ENTRIES
int rc = redfish::EventServiceManager::startEventLogMonitor(*io);
if (rc)