mirror of
https://github.com/Minestom/Minestom.git
synced 2024-11-01 00:10:19 +01:00
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);
|
MinecraftServer.getExceptionManager().handleException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
try {
|
|
||||||
if (socketAddress instanceof UnixDomainSocketAddress unixDomainSocketAddress) {
|
|
||||||
Files.deleteIfExists(unixDomainSocketAddress.getPath());
|
|
||||||
}
|
|
||||||
} catch (IOException e) {
|
|
||||||
MinecraftServer.getExceptionManager().handleException(e);
|
|
||||||
}
|
|
||||||
}, "Ms-entrypoint").start();
|
}, "Ms-entrypoint").start();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -105,6 +98,9 @@ public final class Server {
|
|||||||
this.stop = true;
|
this.stop = true;
|
||||||
try {
|
try {
|
||||||
this.serverSocket.close();
|
this.serverSocket.close();
|
||||||
|
if (socketAddress instanceof UnixDomainSocketAddress unixDomainSocketAddress) {
|
||||||
|
Files.deleteIfExists(unixDomainSocketAddress.getPath());
|
||||||
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
MinecraftServer.getExceptionManager().handleException(e);
|
MinecraftServer.getExceptionManager().handleException(e);
|
||||||
}
|
}
|
||||||
|
@ -37,8 +37,6 @@ public class ServerAddressTest {
|
|||||||
|
|
||||||
assertDoesNotThrow(server::start);
|
assertDoesNotThrow(server::start);
|
||||||
assertDoesNotThrow(server::stop);
|
assertDoesNotThrow(server::stop);
|
||||||
|
|
||||||
Thread.sleep(250);
|
|
||||||
assertFalse(Files.exists(address.getPath()), "The socket file should be deleted");
|
assertFalse(Files.exists(address.getPath()), "The socket file should be deleted");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user