catch the execption during buildSensors
If there any sensor is being created or deleted,
the buildSenosrs will throw exceptions and the application will crash.
Add a retry logic to catch such exception and try again,
will quit the process finally if failed more than 5 times.
Tested:
Changing the PSU sensor threshold using ipmi commands,
no pid service crash log.
Signed-off-by: Yong Li <yong.b.li@linux.intel.com>
Change-Id: Icf96bfb01bce4a3b5c22095f0bef0d793fd8430d
diff --git a/dbus/dbusconfiguration.cpp b/dbus/dbusconfiguration.cpp
index 1ed13b0..02903e0 100644
--- a/dbus/dbusconfiguration.cpp
+++ b/dbus/dbusconfiguration.cpp
@@ -254,7 +254,7 @@
}
std::cout << "New configuration detected, reloading\n.";
- restartControlLoops();
+ tryRestartControlLoops();
});
return 1;