wait server stop

This commit is contained in:
creeper123123321 2021-02-19 09:55:41 -03:00 committed by GitHub
parent 67cafd3e75
commit 181f563b80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -39,6 +39,7 @@ import us.myles.ViaVersion.api.Via
import us.myles.ViaVersion.api.data.MappingDataLoader
import us.myles.ViaVersion.api.protocol.ProtocolVersion
import java.io.File
import java.lang.Thread
import java.net.InetAddress
import java.security.KeyPairGenerator
import java.util.concurrent.CompletableFuture
@ -135,6 +136,7 @@ fun main(args: Array<String>) {
initFuture.complete(Unit)
VIAaaSConsole.start()
while(runningServer) { Thread.sleep(1000L) }
ktorServer?.stop(1000, 1000)
httpClient.close()
@ -146,4 +148,4 @@ fun main(args: Array<String>) {
fun Application.mainWeb() {
ViaWebApp().apply { main() }
}
}