User: rednesto Date: 26 Jan 24 13:33 Revision: 2acbe60f46e90177117a15e13fe4d233601426c6 Summary: Actually set the current facet refresh Job TeamCity URL: https://ci.mcdev.io/viewModification.html?tab=vcsModificationFiles&modId=9067&personal=false Index: src/main/kotlin/facet/MinecraftFacetDetector.kt =================================================================== --- src/main/kotlin/facet/MinecraftFacetDetector.kt (revision 01146d90f185e7922501db82f9e486cd38e47cc0) +++ src/main/kotlin/facet/MinecraftFacetDetector.kt (revision 2acbe60f46e90177117a15e13fe4d233601426c6) @@ -54,6 +54,7 @@ import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Job import kotlinx.coroutines.cancelAndJoin +import kotlinx.coroutines.job import kotlinx.coroutines.launch import org.jetbrains.plugins.gradle.util.GradleUtil @@ -68,8 +69,9 @@ override suspend fun execute(project: Project) { val detectorService = project.service() - detectorService.currentJob?.let { it.cancelAndJoin() } + detectorService.currentJob?.cancelAndJoin() withBackgroundProgress(project, "Detecting Minecraft Frameworks", cancellable = false) { + detectorService.currentJob = coroutineContext.job MinecraftModuleRootListener.doCheck(project) } } @@ -88,8 +90,9 @@ val project = event.source as? Project ?: return val detectorService = project.service() detectorService.scope.launch { - detectorService.currentJob?.let { it.cancelAndJoin() } + detectorService.currentJob?.cancelAndJoin() withBackgroundProgress(project, "Detecting Minecraft Frameworks", cancellable = false) { + detectorService.currentJob = coroutineContext.job doCheck(project) } }