From b53ce4dac1429118888297989ec0746ec9e0fd0c Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Fri, 17 May 2019 20:41:29 +0200 Subject: Added final improvements for release 1.0 Co-authored-by: LarsVomMars --- src/main/kotlin/App.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/main/kotlin/App.kt') diff --git a/src/main/kotlin/App.kt b/src/main/kotlin/App.kt index d9290ba..b6b5a14 100644 --- a/src/main/kotlin/App.kt +++ b/src/main/kotlin/App.kt @@ -12,8 +12,9 @@ import org.slf4j.* import java.net.* import kotlin.system.* -const val debug = true +const val debug = false var silent = true +var port = 7000 // TODO: Add abstract and secure file home support for windows/BSD/macOS val fileHome = if (System.getProperty("os.name") != "Linux" || debug) "files" else "/usr/share/kloud/files" val databaseController = DatabaseController() @@ -23,6 +24,7 @@ private val log = LoggerFactory.getLogger("App.kt") fun main(args: Array) { val app = startServer(args) + log.info("Successfully started server on port $port") // Set up templating RockerRuntime.getInstance().isReloading = false @@ -191,7 +193,6 @@ fun roleManager(handler: Handler, ctx: Context, permittedRoles: Set) { */ fun startServer(args: Array): Javalin { var runServer = true - var port = 7000 args.forEachIndexed { index, element -> run { @@ -226,7 +227,8 @@ fun startServer(args: Array): Javalin { disableStartupBanner() }.start() } catch (_: Exception) { - throw PortUnreachableException("Port already in use!") + log.info("Port $port already in use!") + exitProcess(1) } } else exitProcess(1) } -- cgit v1.2.3