You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicecomb.apache.org by GitBox <gi...@apache.org> on 2018/03/15 06:44:06 UTC

[GitHub] liubao68 closed pull request #597: [SCB-401]keep pull strategy always alive whatever watch strategy state

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


With regards,
Apache Git Services