cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [cloudstack] GabrielBrascher commented on a change in pull request #3737: Add missing HA config keys
Date Wed, 04 Dec 2019 00:50:58 GMT
GabrielBrascher commented on a change in pull request #3737: Add missing HA config keys
URL: https://github.com/apache/cloudstack/pull/3737#discussion_r353482656
 
 

 ##########
 File path: server/src/main/java/com/cloud/ha/HighAvailabilityManagerImpl.java
 ##########
 @@ -844,17 +848,17 @@ 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;
+        value = params.get(TimeToSleep.key());
+        _timeToSleep = NumbersUtil.parseLong(value, parseLong(TimeToSleep.defaultValue()))
* 1000;
 
-        value = params.get("max.retries");
-        _maxRetries = NumbersUtil.parseInt(value, 5);
+        value = params.get(MaxRetries.key());
+        _maxRetries = NumbersUtil.parseInt(value, parseInt(MaxRetries.defaultValue()));
 
-        value = params.get("time.between.failures");
-        _timeBetweenFailures = NumbersUtil.parseLong(value, 3600) * 1000;
+        value = params.get(TimeBetweenFailures.key());
+        _timeBetweenFailures = NumbersUtil.parseLong(value, parseLong(TimeBetweenFailures.defaultValue()))
* 1000;
 
 Review comment:
   It would be nice to change from `1000` to a constant (e.g. MILISECONDS_TO_SECONDS_FACTOR).
I see also a few other values that could be changed into constants, for instance, `10 * 60`
and `1 * 60`). 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message