From 9118dc8fd699573a1ec69e633ec98e0313ec8813 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Oliver=20S=C3=B8berg?= <82504565+sebassonav@users.noreply.github.com> Date: Fri, 18 Oct 2024 16:53:39 +0200 Subject: [PATCH] Svelg redeploy exceptions (#6044) --- .../kotlin/initialisering/EmbeddedServerConfig.kt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/libs/etterlatte-ktor/src/main/kotlin/initialisering/EmbeddedServerConfig.kt b/libs/etterlatte-ktor/src/main/kotlin/initialisering/EmbeddedServerConfig.kt index 57d7b4020c0..d7d27babb04 100644 --- a/libs/etterlatte-ktor/src/main/kotlin/initialisering/EmbeddedServerConfig.kt +++ b/libs/etterlatte-ktor/src/main/kotlin/initialisering/EmbeddedServerConfig.kt @@ -19,6 +19,9 @@ import no.nav.etterlatte.libs.ktor.healthApi import no.nav.etterlatte.libs.ktor.ktor.shutdownPolicyEmbeddedServer import no.nav.etterlatte.libs.ktor.metricsRoute import no.nav.etterlatte.libs.ktor.restModule +import no.nav.etterlatte.logger +import org.slf4j.LoggerFactory +import kotlin.coroutines.cancellation.CancellationException fun initEmbeddedServer( httpPort: Int, @@ -73,6 +76,12 @@ private fun settOppEmbeddedServer( }, ) +val logger = LoggerFactory.getLogger("CIOApplicationEngine") + fun CIOApplicationEngine.run() { - start(true) + try { + start(true) + } catch (e: CancellationException) { + logger.warn("Appen redeployes mens den kjører opp e.l.", e) + } }