diff options
-rw-r--r-- | config-proxy/src/main/java/com/yahoo/vespa/config/proxy/RpcConfigSourceClient.java | 3 | ||||
-rw-r--r-- | vespajlib/src/main/java/com/yahoo/concurrent/SystemTimer.java | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/config-proxy/src/main/java/com/yahoo/vespa/config/proxy/RpcConfigSourceClient.java b/config-proxy/src/main/java/com/yahoo/vespa/config/proxy/RpcConfigSourceClient.java index c09a868a786..9fa0a515abc 100644 --- a/config-proxy/src/main/java/com/yahoo/vespa/config/proxy/RpcConfigSourceClient.java +++ b/config-proxy/src/main/java/com/yahoo/vespa/config/proxy/RpcConfigSourceClient.java @@ -2,6 +2,7 @@ package com.yahoo.vespa.config.proxy; import com.yahoo.concurrent.DaemonThreadFactory; +import com.yahoo.concurrent.SystemTimer; import com.yahoo.config.ConfigurationRuntimeException; import com.yahoo.config.subscription.ConfigSourceSet; import com.yahoo.config.subscription.impl.JrtConfigRequesters; @@ -67,7 +68,7 @@ class RpcConfigSourceClient implements ConfigSourceClient, Runnable { this.memoryCache = new MemoryCache(); this.delayedResponses = new DelayedResponses(); checkConfigSources(); - nextConfigFuture = nextConfigScheduler.scheduleAtFixedRate(this, 0, 10, MILLISECONDS); + nextConfigFuture = nextConfigScheduler.scheduleAtFixedRate(this, 0, 10*1000/SystemTimer.detectHz(), MILLISECONDS); this.requesters = new JrtConfigRequesters(); DelayedResponseHandler command = new DelayedResponseHandler(delayedResponses, memoryCache, responseHandler); this.delayedResponsesFuture = delayedResponsesScheduler.scheduleAtFixedRate(command, 5, 1, SECONDS); diff --git a/vespajlib/src/main/java/com/yahoo/concurrent/SystemTimer.java b/vespajlib/src/main/java/com/yahoo/concurrent/SystemTimer.java index 01abcc0d610..ecaae5e6387 100644 --- a/vespajlib/src/main/java/com/yahoo/concurrent/SystemTimer.java +++ b/vespajlib/src/main/java/com/yahoo/concurrent/SystemTimer.java @@ -16,7 +16,7 @@ public enum SystemTimer implements Timer { private volatile long millis; - private static int detectHz() { + public static int detectHz() { Logger log = Logger.getLogger(SystemTimer.class.getName()); String hzEnv = System.getenv("VESPA_TIMER_HZ"); int hz = 1000; |