diff options
| author | James Feist <james.feist@linux.intel.com> | 2019-11-21 09:02:32 -0800 |
|---|---|---|
| committer | James Feist <james.feist@linux.intel.com> | 2019-11-25 18:42:07 +0000 |
| commit | 9536a14f809bdd7aa71c345ade5b55da6e3f2af6 (patch) | |
| tree | 8e1b7585b54f4248a7365e57963fc4b010c474f0 | |
| parent | 2658d9859a89d2d3c02326e5e2b944480119e0c3 (diff) | |
| download | bmcweb-9536a14f809bdd7aa71c345ade5b55da6e3f2af6.tar.gz bmcweb-9536a14f809bdd7aa71c345ade5b55da6e3f2af6.zip | |
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>
| -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 9127930..fe65ebf 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 |

