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 9757570 commit dc47d79
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ 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.libs.ktor.setReady
import no.nav.etterlatte.logger
import org.slf4j.LoggerFactory
import kotlin.coroutines.cancellation.CancellationException

fun initEmbeddedServer(
httpPort: Int,
Expand Down Expand Up @@ -74,6 +77,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 dc47d79

Please sign in to comment.