You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2018/08/15 16:21:32 UTC

[GitHub] wujimin commented on a change in pull request #872: [SCB-846] ConfigCenterClient log much in the pull mode

wujimin commented on a change in pull request #872: [SCB-846] ConfigCenterClient log much in the pull mode
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/872#discussion_r210324895
 
 

 ##########
 File path: dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ParseConfigUtils.java
 ##########
 @@ -74,14 +74,23 @@ public void initWithUpdateHandler(UpdateHandler updateHandler) {
   public void refreshConfigItems(Map<String, Map<String, Object>> remoteItems) {
     try {
       configLock.lock();
+      String oldRevision = currentVersionInfo;
+      boolean newVersion = false;
       currentVersionInfo =
           remoteItems.getOrDefault("revision", new HashMap<>()).getOrDefault("version", "default").toString();
       //make sure the currentVersionInfo != ""
       currentVersionInfo = currentVersionInfo.equals("") ? "default" : currentVersionInfo;
-      remoteItems.remove("revision");//the key revision is not the config setting
+      if (remoteItems.containsKey("revision")) {
 
 Review comment:
   is it possible contains "revision", but equals oldRevision?
   if impossible, then can simpler the logic: newVersion = remoteItems.remove("revisioin") != null

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