[ 
https://issues.apache.org/jira/browse/SCB-782?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16561463#comment-16561463
 ] 

ASF GitHub Bot commented on SCB-782:
------------------------------------

liubao68 commented on a change in pull request #842: [SCB-782]support revision 
check when use pull mode with config center
URL: 
https://github.com/apache/incubator-servicecomb-java-chassis/pull/842#discussion_r206023906
 
 

 ##########
 File path: 
dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ParseConfigUtils.java
 ##########
 @@ -40,13 +40,20 @@
 
   public static final Map<String, Object> flatItems = new HashMap<>();
 
+  public static String CURRENT_VERSION_INFO = "default";
+
   private UpdateHandler updateHandler;
 
   public ParseConfigUtils(UpdateHandler updateHandler) {
     this.updateHandler = updateHandler;
   }
 
   public void refreshConfigItems(Map<String, Map<String, Object>> remoteItems) 
{
+
+    CURRENT_VERSION_INFO = remoteItems.getOrDefault("revision",new 
HashMap<>()).getOrDefault("version","default").toString();
+    //make sure the CURRENT_VERSION_INFO != ""
+    CURRENT_VERSION_INFO = CURRENT_VERSION_INFO.equals("") ? "default" : 
CURRENT_VERSION_INFO;
+    remoteItems.remove("revision");//the key revision is not the config setting
 
 Review comment:
   How about users have a key named revision?

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


> [SCB-782]support revision check when use pull mode with config center
> ---------------------------------------------------------------------
>
>                 Key: SCB-782
>                 URL: https://issues.apache.org/jira/browse/SCB-782
>             Project: Apache ServiceComb
>          Issue Type: Improvement
>          Components: Java-Chassis
>            Reporter: 何一乐
>            Assignee: 何一乐
>            Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to