diff options
author | Harald Musum <musum@verizonmedia.com> | 2020-07-06 08:43:37 +0200 |
---|---|---|
committer | Harald Musum <musum@verizonmedia.com> | 2020-07-06 08:43:37 +0200 |
commit | 1ae129d887a3cc3b09b0149f530ce19fe95cf7ee (patch) | |
tree | a54b138791ef0e1bb6288f9e43c17bc1bd36dd40 /configserver | |
parent | c44eaefc2f3b541c2a435f360709fd4fc7b1de4d (diff) |
Add listener before starting curator directory cache
Diffstat (limited to 'configserver')
2 files changed, 2 insertions, 2 deletions
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/application/TenantApplications.java b/configserver/src/main/java/com/yahoo/vespa/config/server/application/TenantApplications.java index 638e3565602..2136906f205 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/application/TenantApplications.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/application/TenantApplications.java @@ -87,8 +87,8 @@ public class TenantApplications implements RequestHandler, HostValidator<Applica this.tenant = tenant; this.zkWatcherExecutor = command -> zkWatcherExecutor.execute(tenant, command); this.directoryCache = curator.createDirectoryCache(applicationsPath.getAbsolute(), false, false, zkCacheExecutor); - this.directoryCache.start(); this.directoryCache.addListener(this::childEvent); + this.directoryCache.start(); this.metrics = metrics; this.reloadListener = reloadListener; this.responseFactory = ConfigResponseFactory.create(configserverConfig); diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/tenant/TenantRepository.java b/configserver/src/main/java/com/yahoo/vespa/config/server/tenant/TenantRepository.java index 33ce8f52834..e7888f2663b 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/tenant/TenantRepository.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/tenant/TenantRepository.java @@ -118,8 +118,8 @@ public class TenantRepository { if (useZooKeeperWatchForTenantChanges) { this.directoryCache = Optional.of(curator.createDirectoryCache(tenantsPath.getAbsolute(), false, false, zkCacheExecutor)); - this.directoryCache.get().start(); this.directoryCache.get().addListener(this::childEvent); + this.directoryCache.get().start(); } else { this.directoryCache = Optional.empty(); } |