Fix the PSU Service crash issue.
When entity-manager changes, PSU service will crash when recreating
PSU Sensors. Change delay time to 3s for PSU service has enough time
to finish last creating, change sensor monitoring time to 1s to avoid
sysfs file reading failure.
Tested:
When starting system or reset entity-manager, PSU service will not
crash.
Signed-off-by: Cheng C Yang <cheng.c.yang@linux.intel.com>
Change-Id: I43e7f5207c137cd3601877af5313a3c340ee05f3
diff --git a/src/PSUSensorMain.cpp b/src/PSUSensorMain.cpp
index c5a7251..ce96c72 100644
--- a/src/PSUSensorMain.cpp
+++ b/src/PSUSensorMain.cpp
@@ -836,7 +836,7 @@
std::cerr << "callback method error\n";
return;
}
- filterTimer.expires_from_now(boost::posix_time::seconds(1));
+ filterTimer.expires_from_now(boost::posix_time::seconds(3));
filterTimer.async_wait([&](const boost::system::error_code& ec) {
if (ec == boost::asio::error::operation_aborted)
{