Browse Source

rename timeout to timeoutInMilli for better understanding (#2543)

Jason Song 5 years ago
parent
commit
9742ae288f

+ 1 - 1
apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/config/BizConfig.java

@@ -59,7 +59,7 @@ public class BizConfig extends RefreshableConfig {
     return checkInt(interval, 1, Integer.MAX_VALUE, DEFAULT_GRAY_RELEASE_RULE_SCAN_INTERVAL);
   }
 
-  public long longPollingTimeout() {
+  public long longPollingTimeoutInMilli() {
     int timeout = getIntProperty("long.polling.timeout", DEFAULT_LONG_POLLING_TIMEOUT);
     return 1000 * checkInt(timeout, 1, Integer.MAX_VALUE, DEFAULT_LONG_POLLING_TIMEOUT);
   }

+ 1 - 1
apollo-configservice/src/main/java/com/ctrip/framework/apollo/configservice/controller/NotificationControllerV2.java

@@ -108,7 +108,7 @@ public class NotificationControllerV2 implements ReleaseMessageListener {
       throw new BadRequestException("Invalid format of notifications: " + notificationsAsString);
     }
 
-    DeferredResultWrapper deferredResultWrapper = new DeferredResultWrapper(bizConfig.longPollingTimeout());
+    DeferredResultWrapper deferredResultWrapper = new DeferredResultWrapper(bizConfig.longPollingTimeoutInMilli());
     Set<String> namespaces = Sets.newHashSet();
     Map<String, Long> clientSideNotifications = Maps.newHashMap();
     Map<String, ApolloConfigNotification> filteredNotifications = filterNotifications(appId, notifications);

+ 2 - 2
apollo-configservice/src/main/java/com/ctrip/framework/apollo/configservice/wrapper/DeferredResultWrapper.java

@@ -23,8 +23,8 @@ public class DeferredResultWrapper {
   private DeferredResult<ResponseEntity<List<ApolloConfigNotification>>> result;
 
 
-  public DeferredResultWrapper(long timeout) {
-    result = new DeferredResult<>(timeout, NOT_MODIFIED_RESPONSE_LIST);
+  public DeferredResultWrapper(long timeoutInMilli) {
+    result = new DeferredResult<>(timeoutInMilli, NOT_MODIFIED_RESPONSE_LIST);
   }
 
   public void recordNamespaceNameNormalizedResult(String originalNamespaceName, String normalizedNamespaceName) {