diff options
author | Harald Musum <musum@verizonmedia.com> | 2019-09-08 11:00:04 +0200 |
---|---|---|
committer | Harald Musum <musum@verizonmedia.com> | 2019-09-08 11:00:04 +0200 |
commit | fbfbd9f1d8afa4660750bb0bd8cffe0dfd682ca2 (patch) | |
tree | 0a55ec2b6d2dad601a1d233d8c08ce13e98e8bc2 /config-proxy | |
parent | a439476f948f52a57485f5e7700b17bf9aa73417 (diff) |
Fix mode switching
Use the new mode when switching and log correctly
Diffstat (limited to 'config-proxy')
-rw-r--r-- | config-proxy/src/main/java/com/yahoo/vespa/config/proxy/ProxyServer.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/config-proxy/src/main/java/com/yahoo/vespa/config/proxy/ProxyServer.java b/config-proxy/src/main/java/com/yahoo/vespa/config/proxy/ProxyServer.java index cd515383950..d77206aee81 100644 --- a/config-proxy/src/main/java/com/yahoo/vespa/config/proxy/ProxyServer.java +++ b/config-proxy/src/main/java/com/yahoo/vespa/config/proxy/ProxyServer.java @@ -114,8 +114,9 @@ public class ProxyServer implements Runnable { void setMode(String modeName) { if (modeName.equals(this.mode.name())) return; - String oldMode = this.mode.name(); - switch (mode.getMode()) { + Mode oldMode = this.mode; + Mode newMode = new Mode(modeName); + switch (newMode.getMode()) { case MEMORYCACHE: configClient.shutdownSourceConnections(); configClient = new MemoryCacheConfigClient(memoryCache); @@ -129,7 +130,7 @@ public class ProxyServer implements Runnable { default: throw new IllegalArgumentException("Cannot set invalid mode '" + modeName + "'"); } - log.log(LogLevel.INFO, "Switching from '" + oldMode + "' mode to '" + modeName.toLowerCase() + "' mode"); + log.log(LogLevel.INFO, "Switched from '" + oldMode.name().toLowerCase() + "' mode to '" + getMode().name().toLowerCase() + "' mode"); } private ConfigSourceClient createClient(RpcServer rpcServer, DelayedResponses delayedResponses, |