We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
configureLifecycle
1 parent 47300d0 commit c1100f3Copy full SHA for c1100f3
core/src/main/kotlin/plugins/Lifecycle.kt
@@ -32,6 +32,8 @@ import org.eclipse.apoapsis.ortserver.utils.logging.withMdcContext
32
33
import org.koin.ktor.ext.inject
34
35
+import org.slf4j.MDC
36
+
37
/**
38
* Configure actions that are triggered by
39
* [lifecycle events][https://ktor.io/docs/events.html#handle-events-application].
@@ -40,7 +42,10 @@ fun Application.configureLifecycle() {
40
42
environment.monitor.subscribe(DatabaseReady) {
41
43
val authorizationService by inject<AuthorizationService>()
44
45
+ val mdcContext = MDC.getCopyOfContextMap()
46
47
thread {
48
+ MDC.setContextMap(mdcContext)
49
runBlocking(Dispatchers.IO) {
50
syncRoles(authorizationService)
51
}
0 commit comments