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

 ##########
 File path: engine/components-api/src/main/java/com/cloud/ha/HighAvailabilityManager.java
 ##########
 @@ -16,18 +16,36 @@
 // under the License.
 package com.cloud.ha;
 
-import java.util.List;
+import static java.lang.String.valueOf;
 
 import com.cloud.deploy.DeploymentPlanner;
 import com.cloud.host.HostVO;
 import com.cloud.host.Status;
 import com.cloud.utils.component.Manager;
 import com.cloud.vm.VMInstanceVO;
+import org.apache.cloudstack.framework.config.ConfigKey;
+
+import java.util.List;
 
 /**
  * HighAvailabilityManager checks to make sure the VMs are running fine.
  */
 public interface HighAvailabilityManager extends Manager {
+
+    ConfigKey<Long> TimeBetweenCleanup = new ConfigKey<>("Advanced", Long.class,
+        "time.between.cleanup", valueOf(3600 * 24), "Time in seconds to wait before the cleanup
thread runs.",
 
 Review comment:
   I was wondering, why use `valueOf` on the ConfigKeys? It makes sense in terms of readability
and the fact that you can externalize the value to a constant (which is great :slightly_smiling_face:)
and then convert it into a String. Specially in this case of `(3600 * 24)`. Otherwise a string
"86400" looks better (in my opinion).

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