You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by li...@apache.org on 2018/03/15 06:44:07 UTC
[incubator-servicecomb-java-chassis] branch master updated:
[SCB-401]keep pull strategy always alive whatever watch strategy state
This is an automated email from the ASF dual-hosted git repository.
liubao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-java-chassis.git
The following commit(s) were added to refs/heads/master by this push:
new 8dd1f6a [SCB-401]keep pull strategy always alive whatever watch strategy state
8dd1f6a is described below
commit 8dd1f6a7e259cfe88a6d3ca60eeff342818233f8
Author: m00416667 <me...@huawei.com>
AuthorDate: Thu Mar 15 11:46:03 2018 +0800
[SCB-401]keep pull strategy always alive whatever watch strategy state
---
.../serviceregistry/registry/RemoteServiceRegistry.java | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
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 e8f0bf5..2a60472 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 class RemoteServiceRegistry extends AbstractServiceRegistry {
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);
--
To stop receiving notification emails like this one, please contact
liubao@apache.org.