Move proxy shutdown to take place in a new thread.

This commit is contained in:
Andrew Steinborn
2019-05-23 15:09:11 -04:00
parent df7eb4ade0
commit 3cee15a9cb

View File

@@ -355,6 +355,8 @@ public class VelocityServer implements ProxyServer {
if (!shutdownInProgress.compareAndSet(false, true)) {
return;
}
Runnable shutdownProcess = () -> {
logger.info("Shutting down the proxy...");
for (ConnectedPlayer player : ImmutableList.copyOf(connectionsByUuid.values())) {
@@ -379,6 +381,10 @@ public class VelocityServer implements ProxyServer {
if (explicitExit) {
System.exit(0);
}
};
Thread thread = new Thread(shutdownProcess);
thread.start();
}
public NettyHttpClient getHttpClient() {