mirror of https://github.com/Minestom/Minestom.git
Move removal of unix socket file
This commit is contained in:
parent
078d2ef670
commit
49e727d177
|
@ -87,13 +87,6 @@ public final class Server {
|
|||
MinecraftServer.getExceptionManager().handleException(e);
|
||||
}
|
||||
}
|
||||
try {
|
||||
if (socketAddress instanceof UnixDomainSocketAddress unixDomainSocketAddress) {
|
||||
Files.deleteIfExists(unixDomainSocketAddress.getPath());
|
||||
}
|
||||
} catch (IOException e) {
|
||||
MinecraftServer.getExceptionManager().handleException(e);
|
||||
}
|
||||
}, "Ms-entrypoint").start();
|
||||
}
|
||||
|
||||
|
@ -105,6 +98,9 @@ public final class Server {
|
|||
this.stop = true;
|
||||
try {
|
||||
this.serverSocket.close();
|
||||
if (socketAddress instanceof UnixDomainSocketAddress unixDomainSocketAddress) {
|
||||
Files.deleteIfExists(unixDomainSocketAddress.getPath());
|
||||
}
|
||||
} catch (IOException e) {
|
||||
MinecraftServer.getExceptionManager().handleException(e);
|
||||
}
|
||||
|
|
|
@ -37,8 +37,6 @@ public class ServerAddressTest {
|
|||
|
||||
assertDoesNotThrow(server::start);
|
||||
assertDoesNotThrow(server::stop);
|
||||
|
||||
Thread.sleep(250);
|
||||
assertFalse(Files.exists(address.getPath()), "The socket file should be deleted");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue