Skip to content

Commit

Permalink
Svelg redeploy exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
sebassonav committed Oct 18, 2024
1 parent d55de52 commit a90bd8c
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
}
}

0 comments on commit a90bd8c

Please sign in to comment.