Join Slack
Powered by
I am trying to install application event but it is...
# ktor
o
oshai
09/20/2018, 11:33 PM
I am trying to install application event but it is not running at startup
d
Deactivated User
09/21/2018, 2:36 AM
My bet is that the event was already triggered
Deactivated User
09/21/2018, 2:37 AM
but let me confirm
Deactivated User
09/21/2018, 4:16 AM
https://github.com/ktorio/ktor/blob/afa1a2fd11131620b6870d013ca65039b7ce0c63/ktor-server/ktor-server-host-common/src/io/ktor/server/engine/ApplicationEngineEnvironmentReloading.kt#L257-L263
Deactivated User
09/21/2018, 4:17 AM
that event is triggered before modules are loaded, so probably relevant when setting up the environment. There is another event that triggers after the modules have been loaded (triggered in that same function):
ApplicationStarted
Deactivated User
09/21/2018, 4:21 AM
It is used for example for the engines:
https://github.com/ktorio/ktor/blob/afa1a2fd11131620b6870d013ca65039b7ce0c63/ktor-server/ktor-server-host-common/src/io/ktor/server/engine/BaseApplicationEngine.kt#L29
And it is referenced here:
https://github.com/ktorio/ktor/blob/afa1a2fd11131620b6870d013ca65039b7ce0c63/ktor-server/ktor-server-core/src/io/ktor/features/CallLogging.kt#L67
But I bet, it is misleading and it is not being triggered since you install that feature after that event is triggered
o
oshai
09/21/2018, 6:36 AM
thanks
👍 1
3
Views
Open in Slack
Previous
Next