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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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