diff options
author | James Feist <james.feist@linux.intel.com> | 2019-11-21 20:02:32 +0300 |
---|---|---|
committer | James Feist <james.feist@linux.intel.com> | 2019-11-25 21:42:07 +0300 |
commit | 9536a14f809bdd7aa71c345ade5b55da6e3f2af6 (patch) | |
tree | 8e1b7585b54f4248a7365e57963fc4b010c474f0 /redfish-core | |
parent | 2658d9859a89d2d3c02326e5e2b944480119e0c3 (diff) | |
download | bmcweb-9536a14f809bdd7aa71c345ade5b55da6e3f2af6.tar.xz |
Health: Allow populate to only be called once
Populate does a mapper call and a get managed objects
and should only be called once. Enforce it.
Tested: No actual change, it is currently never called
twice, this is just for future protection with multiple
async calls.
Change-Id: I8fb9d8d19b2aa2a1c957a0ac8b609adf5e6ba6d0
Signed-off-by: James Feist <james.feist@linux.intel.com>
Diffstat (limited to 'redfish-core')
-rw-r--r-- | redfish-core/lib/health.hpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/redfish-core/lib/health.hpp b/redfish-core/lib/health.hpp index 91279304e5..fe65ebfbcb 100644 --- a/redfish-core/lib/health.hpp +++ b/redfish-core/lib/health.hpp @@ -148,6 +148,11 @@ struct HealthPopulate : std::enable_shared_from_this<HealthPopulate> // being added as children to the 'main' health object for the page void populate() { + if (populated) + { + return; + } + populated = true; getAllStatusAssociations(); getGlobalPath(); } @@ -210,5 +215,6 @@ struct HealthPopulate : std::enable_shared_from_this<HealthPopulate> bool isManagersHealth = false; dbus::utility::ManagedObjectType statuses; std::string globalInventoryPath = "-"; // default to illegal dbus path + bool populated = false; }; } // namespace redfish
\ No newline at end of file |