liubao68 closed pull request #597: [SCB-401]keep pull strategy always alive 
whatever watch strategy state
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/597
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/registry/RemoteServiceRegistry.java
 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/registry/RemoteServiceRegistry.java
index e8f0bf535..2a6047285 100644
--- 
a/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/registry/RemoteServiceRegistry.java
+++ 
b/service-registry/src/main/java/org/apache/servicecomb/serviceregistry/registry/RemoteServiceRegistry.java
@@ -81,19 +81,16 @@ public void run() {
         serviceRegistryConfig.getHeartbeatInterval(),
         serviceRegistryConfig.getHeartbeatInterval(),
         TimeUnit.SECONDS);
-    if (isNeedPull()) {
+
       taskPool.scheduleAtFixedRate(
           () -> eventBus.post(new PeriodicPullEvent()),
           serviceRegistryConfig.getInstancePullInterval(),
           serviceRegistryConfig.getInstancePullInterval(),
           TimeUnit.SECONDS);
-    }
-  }
 
-  private boolean isNeedPull() {
-    return !serviceRegistryConfig.isWatch();
   }
 
+
   @Subscribe
   public void 
onPullMicroserviceVersionsInstancesEvent(PullMicroserviceVersionsInstancesEvent 
event) {
     taskPool.schedule(event.getMicroserviceVersions()::pullInstances, 
event.getMsDelay(), TimeUnit.MILLISECONDS);


 

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to