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:52:33 GMT
GabrielBrascher commented on a change in pull request #3737: Add missing HA config keys
URL: https://github.com/apache/cloudstack/pull/3737#discussion_r353499217
 
 

 ##########
 File path: server/src/main/java/com/cloud/ha/HighAvailabilityManagerImpl.java
 ##########
 @@ -846,16 +848,16 @@ public boolean configure(final String name, final Map<String, Object>
xmlParams)
         _forceHA = Boolean.parseBoolean(value);
 
         value = params.get(TimeToSleep.key());
-        _timeToSleep = (long)NumbersUtil.parseInt(value, 60) * 1000;
+        _timeToSleep = NumbersUtil.parseLong(value, parseLong(TimeToSleep.defaultValue()))
* 1000;
 
 Review comment:
   I am wondering; why did you use `defaultValue` instead of `value`? The default value is
not updated when the configuration value changes. You can use `TimeToSleep.value()` that will
return a Long.
   
   My 2 cents would be to change it into something like:
   ```
   private static final long MILLISECONDS_TO_SECONDS_FACTOR = 1000
   
   (...)
   
   _timeToSleep = TimeToSleep.value() * MILISECONDS_TO_SECONDS_FACTOR
   ```
   Same goes with `_maxRetries = MaxRetries.value()` etc.

----------------------------------------------------------------
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