Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for can auto-reload on ktor #1797

Merged
merged 2 commits into from Mar 29, 2024

Conversation

momosetkn
Copy link
Contributor

Fix not working ktor-server auto-reload problem(#1792, #1782).

@momosetkn momosetkn changed the title Can auto-reload on ktor Fix for can auto-reload on ktor Feb 25, 2024
@@ -34,7 +35,8 @@ import org.koin.dsl.KoinAppDeclaration
*/
val Koin = createApplicationPlugin(name = "Koin", createConfiguration = { KoinApplication.init() }) {
val koinApplication = setupKoinApplication()
startKoin(koinApplication)
runningKoinApplication?.let { stopKoin() } // for ktor auto-reload
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are keeping a ref on the Koin context instance here. Either I would suggest using KoinPlatformTools.defaultContext().getOrNull() to request current Koin context and see if it's null

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx.
surely.my way is contrary to SSOT(single source of truth).
I changed to use KoinPlatformTools.defaultContext().getOrNull().

@arnaudgiuliani arnaudgiuliani modified the milestones: core-3.6.0, ktor-3.6.0 Feb 29, 2024
@arnaudgiuliani arnaudgiuliani added status:accepted accepted to be developed ktor labels Feb 29, 2024
@arnaudgiuliani arnaudgiuliani modified the milestones: ktor-3.6.0, 3.5.4-RC Mar 29, 2024
@arnaudgiuliani arnaudgiuliani changed the base branch from main to 3.5.4 March 29, 2024 08:57
@arnaudgiuliani
Copy link
Member

added for 3.5.4 fixes

@arnaudgiuliani arnaudgiuliani merged commit 78d9e70 into InsertKoinIO:3.5.4 Mar 29, 2024
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ktor status:accepted accepted to be developed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants