mirror of
https://github.com/tachiyomiorg/tachiyomi-extensions-inspector.git
synced 2025-02-28 22:43:38 +01:00
Stop Javalin properly on shutdown (#69)
This commit is contained in:
parent
59cbe5d5bc
commit
1dd029559e
@ -44,6 +44,7 @@ import java.io.IOException
|
|||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
import java.util.Date
|
import java.util.Date
|
||||||
import java.util.concurrent.CompletableFuture
|
import java.util.concurrent.CompletableFuture
|
||||||
|
import kotlin.concurrent.thread
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (C) Contributors to the Suwayomi project
|
* Copyright (C) Contributors to the Suwayomi project
|
||||||
@ -75,6 +76,13 @@ object JavalinSetup {
|
|||||||
}
|
}
|
||||||
config.enableCorsForAllOrigins()
|
config.enableCorsForAllOrigins()
|
||||||
}.start(serverConfig.ip, serverConfig.port)
|
}.start(serverConfig.ip, serverConfig.port)
|
||||||
|
|
||||||
|
Runtime.getRuntime().addShutdownHook(
|
||||||
|
thread(start = false) {
|
||||||
|
app.stop()
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
if (hasWebUiBundled && serverConfig.initialOpenInBrowserEnabled) {
|
if (hasWebUiBundled && serverConfig.initialOpenInBrowserEnabled) {
|
||||||
openInBrowser()
|
openInBrowser()
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user