title: how to keep data consistent when using @RefreshScope in a execution
body: <p>I read this <a href="https://gist.github.com/dsyer/a43fe5f74427b371519af68c5c4904c7" rel="nofollow noreferrer">Dynamic Configuration Properties in Spring Boot and Spring Cloud</a>
  And it said that</p>
  
  <blockquote>
    <p>If your method execution is the one that triggers the initialization,
    then it all even happens in the same thread.</p>
  </blockquote>
  
  <p>This is my code, a <strong>TestConfigBean</strong>:</p>
  
  <pre><code> package com.my.springdemo.chapter3.test;
  
  import lombok.Data;
  import org.springframework.beans.factory.annotation.Value;
  import org.springframework.cloud.context.config.annotation.RefreshScope;
  import org.springframework.stereotype.Component;
  
  import javax.annotation.PostConstruct;
  
  @Component
  @Data
  @RefreshScope
  public class TestConfig {
      @Value("${name}")
      private String name;
  
      @PostConstruct
      private void print(){
          System.out.println("配置为=" + name);
      }
  }
  </code></pre>
  
  <p><strong>A controller</strong>:</p>
  
  <pre><code>package com.my.springdemo.chapter3.test;
  
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
  import org.springframework.cloud.context.refresh.ContextRefresher;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.bind.annotation.RestController;
  
  @ConditionalOnClass(ContextRefresher.class)
  @RestController
  public class TestController {
  
      @Autowired
      private TestConfig config;
  
      @Autowired
      private  ContextRefresher contextRefresher;
  
      @RequestMapping("/config")
      public String config(){
          System.out.println("before config= " + config.getName() + ", hasCode=" + config.hashCode());
          try {
              Thread.sleep(10000);
          } catch (InterruptedException e) {
              e.printStackTrace();
          }
          contextRefresher.refresh();
          System.out.println("After config= " + config.getName() + ", hasCode=" + config.hashCode());
          return config.getName();
      }
  
  }
  </code></pre>
  
  <p>Then get url: <a href="http://localhost:8080/config" rel="nofollow noreferrer">http://localhost:8080/config</a>, and changed config "<em>name</em>" in my "<strong>application.properties</strong>" during the thread sleep time(which id 10 seconds as the code shows).</p>
  
  <p>It turns out that the config "<em>name</em>" is changed before and after.
  Why?Does I take @RefreshScope the wrong way?</p>