mirror of
https://github.com/ViaVersion/VIAaaS.git
synced 2024-11-21 11:55:15 +01:00
try to fix stopping when starting fails
This commit is contained in:
parent
4dc07fe731
commit
6e9fe83bcc
@ -188,6 +188,10 @@ private fun stopServer() {
|
|||||||
Via.getManager().connectionManager.connections.forEach {
|
Via.getManager().connectionManager.connections.forEach {
|
||||||
it.channel?.pipeline()?.get(MinecraftHandler::class.java)?.disconnect("Stopping")
|
it.channel?.pipeline()?.get(MinecraftHandler::class.java)?.disconnect("Stopping")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
(Via.getManager() as ViaManagerImpl).destroy()
|
||||||
|
} finally {
|
||||||
|
finishedFuture.complete(Unit)
|
||||||
ktorServer?.stop(1000, 1000)
|
ktorServer?.stop(1000, 1000)
|
||||||
httpClient.close()
|
httpClient.close()
|
||||||
listOf<Future<*>?>(
|
listOf<Future<*>?>(
|
||||||
@ -196,10 +200,6 @@ private fun stopServer() {
|
|||||||
childLoop.shutdownGracefully()
|
childLoop.shutdownGracefully()
|
||||||
)
|
)
|
||||||
.forEach { it?.sync() }
|
.forEach { it?.sync() }
|
||||||
|
|
||||||
(Via.getManager() as ViaManagerImpl).destroy()
|
|
||||||
} finally {
|
|
||||||
finishedFuture.complete(Unit)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user