Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-11-17 05:20:14 +01:00
Move proxy shutdown to take place in a new thread.
Dieser Commit ist enthalten in:
Ursprung
df7eb4ade0
Commit
3cee15a9cb
@ -355,6 +355,8 @@ public class VelocityServer implements ProxyServer {
|
|||||||
if (!shutdownInProgress.compareAndSet(false, true)) {
|
if (!shutdownInProgress.compareAndSet(false, true)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Runnable shutdownProcess = () -> {
|
||||||
logger.info("Shutting down the proxy...");
|
logger.info("Shutting down the proxy...");
|
||||||
|
|
||||||
for (ConnectedPlayer player : ImmutableList.copyOf(connectionsByUuid.values())) {
|
for (ConnectedPlayer player : ImmutableList.copyOf(connectionsByUuid.values())) {
|
||||||
@ -379,6 +381,10 @@ public class VelocityServer implements ProxyServer {
|
|||||||
if (explicitExit) {
|
if (explicitExit) {
|
||||||
System.exit(0);
|
System.exit(0);
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Thread thread = new Thread(shutdownProcess);
|
||||||
|
thread.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
public NettyHttpClient getHttpClient() {
|
public NettyHttpClient getHttpClient() {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren