Speed up managers schema
PID was doing every query 8x times.
Change-Id: I11fa064c2f9c416fe15fdfb15c63a6490f0b68dd
Signed-off-by: James Feist <james.feist@linux.intel.com>
diff --git a/redfish-core/lib/managers.hpp b/redfish-core/lib/managers.hpp
index 9aa2986..9e9d150 100644
--- a/redfish-core/lib/managers.hpp
+++ b/redfish-core/lib/managers.hpp
@@ -328,10 +328,17 @@
// create map of <connection, path to objMgr>>
boost::container::flat_map<std::string, std::string>
objectMgrPaths;
+ boost::container::flat_set<std::string> calledConnections;
for (const auto& pathGroup : subtree)
{
for (const auto& connectionGroup : pathGroup.second)
{
+ auto findConnection =
+ calledConnections.find(connectionGroup.first);
+ if (findConnection != calledConnections.end())
+ {
+ break;
+ }
for (const std::string& interface :
connectionGroup.second)
{
@@ -353,6 +360,9 @@
<< "Has no Object Manager";
continue;
}
+
+ calledConnections.insert(connectionGroup.first);
+
asyncPopulatePid(findObjMgr->first,
findObjMgr->second, asyncResp);
break;