IJPL-158881 pass coroutine scope instead of disposable

GitOrigin-RevId: 7c504251da3bc7544ac55a53067d984cb7d1df12
This commit is contained in:
Vladimir Krivosheev
2024-07-23 08:03:26 +02:00
committed by intellij-monorepo-bot
parent ea9220c042
commit bba9eb9923

View File

@@ -64,11 +64,11 @@ class VcsRepositoryManager @ApiStatus.Internal constructor(private val project:
project.messageBus.connect(coroutineScope).subscribe(ProjectLevelVcsManager.VCS_CONFIGURATION_CHANGED,
VcsMappingListener { this.scheduleUpdate() })
EP_NAME.addChangeListener({
disposeAllRepositories(false)
scheduleUpdate()
BackgroundTaskUtil.syncPublisher(project, VCS_REPOSITORY_MAPPING_UPDATED).mappingChanged()
}, this)
EP_NAME.addChangeListener(coroutineScope) {
disposeAllRepositories(false)
scheduleUpdate()
BackgroundTaskUtil.syncPublisher(project, VCS_REPOSITORY_MAPPING_UPDATED).mappingChanged()
}
updateAlarm = Alarm(
threadToUse = Alarm.ThreadToUse.POOLED_THREAD,
parentDisposable = null,
@@ -247,6 +247,7 @@ class VcsRepositoryManager @ApiStatus.Internal constructor(private val project:
return null
}
@Suppress("NAME_SHADOWING")
var updateIfNeeded = updateIfNeeded
val app = ApplicationManager.getApplication()
if (updateIfNeeded && app.isDispatchThread && !app.isUnitTestMode && !app.isHeadlessEnvironment) {