Skip to content

Commit 3e95166

Browse files
authored
Merge pull request #2477 from digma-ai/catch-cancel-in-NavigationDiscoveryChangeService
catch-cancel-in-NavigationDiscoveryChangeService
2 parents d1f0296 + eabc00a commit 3e95166

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

jvm-common/src/main/kotlin/org/digma/intellij/plugin/idea/navigation/NavigationDiscoveryChangeService.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ class NavigationDiscoveryChangeService(private val project: Project, private val
210210
or when doing a refactor that impacts many files.
211211
when that happens it doesn't make sense to update the files one by one, it will take too long, the changedFiles and
212212
bulkEvents lists will grow too large. and the executor service queue of the navigation discovery will grow too large.
213-
we see sometimes updates of thousands of files. one example if to open the intellij-community repository and change branch,
213+
we see sometimes updates of thousands of files. one example is to open the intellij-community repository and change branch,
214214
it will trigger an update of more than 40000 files. and we see also users with this amount of updates.
215215
216216
when we discover a large update we want to:
@@ -299,6 +299,8 @@ class NavigationDiscoveryChangeService(private val project: Project, private val
299299

300300
delay(1000)
301301
}
302+
} catch (ce: CancellationException) {
303+
throw ce
302304
} catch (e: Throwable) {
303305
//there should not be an exception here, the code in the try block should not produce any error.
304306
// but protect against who knows what. we must make sure that resume is called eventually.
@@ -320,6 +322,8 @@ class NavigationDiscoveryChangeService(private val project: Project, private val
320322
val javaEndpointNavigationProvider = JvmEndpointNavigationProvider.getInstance(project)
321323
javaEndpointNavigationProvider.buildNavigationDiscoveryFullUpdate()
322324
}
325+
} catch (ce: CancellationException) {
326+
throw ce
323327
} catch (e: Throwable) {
324328
Log.warnWithException(logger, project, e, "error launching full update {}", e)
325329
ErrorReporter.getInstance().reportError("NavigationDiscoveryChangeService.pauseAndLaunchFullUpdate", e)

0 commit comments

Comments
 (0)