@@ -36,20 +36,15 @@ public InsightsProvider(Project project) {
3636 this .project = project ;
3737 }
3838
39- public InsightsListContainer getInsights (@ NotNull MethodInfo methodInfo ) {
39+ public InsightsListContainer getUpdatedInsightsList (@ NotNull MethodInfo methodInfo ) {
4040 List <? extends CodeObjectInsight > upToDateInsightsList ;
4141 List <String > objectIds = getObjectIds (methodInfo );
4242 Log .log (LOGGER ::debug , "Got following code object ids for method {}: {}" , methodInfo .getId (), objectIds );
4343 var stopWatch = StopWatch .createStarted ();
4444 try {
45- upToDateInsightsList = analyticsService .getInsights (objectIds );
46- } catch (AnalyticsServiceException e ) {
47- //if analyticsService.getInsights throws exception it means insights could not be loaded, usually when
48- //the backend is not available. return an empty InsightsListContainer to keep everything running and don't
49- //crash the plugin. don't log the exception, it was logged in AnalyticsService, keep the log quite because
50- //it may happen many times.
51- Log .log (LOGGER ::debug , "AnalyticsServiceException for getInsights for {}: {}" , methodInfo .getId (), e .getMessage ());
52- return new InsightsListContainer ();
45+ //refresh insights cache
46+ documentInfoService .refreshAll ();
47+ upToDateInsightsList = documentInfoService .getCachedMethodInsights (methodInfo );
5348 } finally {
5449 stopWatch .stop ();
5550 Log .log (LOGGER ::debug , "getInsights time took {} milliseconds" , stopWatch .getTime (TimeUnit .MILLISECONDS ));
0 commit comments