ScriptClassRootsUpdater: fix clearing scheduledUpdate and check cancelled in sync

This commit is contained in:
Sergey Rostov
2020-05-07 15:45:26 +03:00
parent 6c3a6f8bc2
commit bc0255890d
@@ -123,12 +123,14 @@ class ScriptClassRootsUpdater(
fun doUpdate(underProgressManager: Boolean = true) {
syncLock.withLock {
val updates = manager.collectRootsAndCheckNew()
if (!updates.changed) return
try {
ProgressManager.checkCanceled()
val updates = manager.collectRootsAndCheckNew()
if (!updates.changed) return
if (underProgressManager) {
ProgressManager.checkCanceled()
}
if (updates.hasNewRoots) {
notifyRootsChanged()