DaanHoogland commented on a change in pull request #3776: Fix HA config keys
URL: https://github.com/apache/cloudstack/pull/3776#discussion_r359927558
 
 

 ##########
 File path: server/src/main/java/com/cloud/ha/HighAvailabilityManagerImpl.java
 ##########
 @@ -844,29 +851,25 @@ public boolean configure(final String name, final 
Map<String, Object> xmlParams)
         value = params.get("force.ha");
         _forceHA = Boolean.parseBoolean(value);
 
-        value = params.get("time.to.sleep");
-        _timeToSleep = (long)NumbersUtil.parseInt(value, 60) * 1000;
+        _timeToSleep = TimeToSleep.value() * SECONDS_TO_MILLISECONDS_FACTOR;
 
-        value = params.get("max.retries");
-        _maxRetries = NumbersUtil.parseInt(value, 5);
+        _maxRetries = MaxRetries.value();
 
-        value = params.get("time.between.failures");
-        _timeBetweenFailures = NumbersUtil.parseLong(value, 3600) * 1000;
+        _timeBetweenFailures = TimeBetweenFailures.value() * 
SECONDS_TO_MILLISECONDS_FACTOR;
 
-        value = params.get("time.between.cleanup");
-        _timeBetweenCleanups = NumbersUtil.parseLong(value, 3600 * 24);
+        _timeBetweenCleanups = TimeBetweenCleanup.value();
 
         value = params.get("stop.retry.interval");
-        _stopRetryInterval = NumbersUtil.parseInt(value, 10 * 60);
+        _stopRetryInterval = NumbersUtil.parseInt(value, 
STOP_RETRY_INTERVAL_SECONDS);
 
         value = params.get("restart.retry.interval");
-        _restartRetryInterval = NumbersUtil.parseInt(value, 10 * 60);
+        _restartRetryInterval = NumbersUtil.parseInt(value, 
RESTART_RETRY_INTERVAL_SECONDS);
 
         value = params.get("investigate.retry.interval");
-        _investigateRetryInterval = NumbersUtil.parseInt(value, 1 * 60);
+        _investigateRetryInterval = NumbersUtil.parseInt(value, 
INVESTIGATE_RETRY_INTERVAL_SECONDS);
 
         value = params.get("migrate.retry.interval");
-        _migrateRetryInterval = NumbersUtil.parseInt(value, 2 * 60);
+        _migrateRetryInterval = NumbersUtil.parseInt(value, 
MIGRATE_RETRY_INTERVAL_SECONDS);
 
 Review comment:
   and `time.between.cleanup`, `time.between.failures`, `max.retries` and 
`time.to.sleep`
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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