rhtyd commented on a change in pull request #2292: CLOUDSTACK-10108:ConfigKey 
based approach for reading 'ping' configua?
URL: https://github.com/apache/cloudstack/pull/2292#discussion_r158672304
 
 

 ##########
 File path: engine/schema/src/com/cloud/host/dao/HostDaoImpl.java
 ##########
 @@ -993,8 +991,8 @@ public boolean updateState(Status oldStatus, Event event, 
Status newStatus, Host
             }
         }
         if (event.equals(Event.ManagementServerDown)) {
-            Float pingTimeout = 
NumbersUtil.parseFloat(_configDao.getValue("ping.timeout"), 2.5f);
-            Integer pingInterval = 
NumbersUtil.parseInt(_configDao.getValue("ping.interval"), 60);
+            float pingTimeout = 
ManagementServiceConfiguration.PingTimeout.value();
+            int pingInterval = 
ManagementServiceConfiguration.PingInterval.value();
             ub.set(host, _pingTimeAttr, ((System.currentTimeMillis() >> 10) - 
(long)(pingTimeout * pingInterval)));
 
 Review comment:
   The value `pingTimeout * pingInterval` is used again, this can be consumed 
from the class/interface of `ManagementServiceConfiguration` via a 
`getTimeout()` that is also used in `AgentManagerImpl.java`.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to