Fix query listener reload bug (#1322)

This commit is contained in:
Pantera (Mad_Daniel)
2024-05-24 03:12:28 +09:00
committed by GitHub
parent a02b601b6c
commit 71bb0246a8

View File

@@ -469,11 +469,11 @@ public class VelocityServer implements ProxyServer, ForwardingAudience {
boolean queryPortChanged = newConfiguration.getQueryPort() != configuration.getQueryPort(); boolean queryPortChanged = newConfiguration.getQueryPort() != configuration.getQueryPort();
boolean queryAlreadyEnabled = configuration.isQueryEnabled(); boolean queryAlreadyEnabled = configuration.isQueryEnabled();
boolean queryEnabled = newConfiguration.isQueryEnabled(); boolean queryEnabled = newConfiguration.isQueryEnabled();
if ((!queryEnabled && queryAlreadyEnabled) || queryPortChanged) { if (queryAlreadyEnabled && (!queryEnabled || queryPortChanged)) {
this.cm.close(new InetSocketAddress( this.cm.close(new InetSocketAddress(
configuration.getBind().getHostString(), configuration.getQueryPort())); configuration.getBind().getHostString(), configuration.getQueryPort()));
} }
if (queryEnabled && queryPortChanged) { if (queryEnabled && (!queryAlreadyEnabled || queryPortChanged)) {
this.cm.queryBind(newConfiguration.getBind().getHostString(), this.cm.queryBind(newConfiguration.getBind().getHostString(),
newConfiguration.getQueryPort()); newConfiguration.getQueryPort());
} }