Skip to content

Commit 5e6652d

Browse files
committed
fix HashContent cache invalidation
1 parent f7af528 commit 5e6652d

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/main/java/ai/deepcode/jbplugin/core/AnalysisData.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ public static boolean isUpdateAnalysisInProgress() {
142142

143143
public static void waitForUpdateAnalysisFinish() {
144144
while (updateInProgress) {
145+
// delay should be less or equal to runInBackgroundCancellable delay
145146
RunUtils.delay(100);
146147
}
147148
}
@@ -177,13 +178,11 @@ public static void updateCachedResultsForFiles(
177178
info(
178179
"Files to proceed (not found in cache): "
179180
+ filesToProceed.size()
180-
// fixme debug only
181181
+ "\nHash for first file "
182182
+ firstFile.getName()
183183
+ " ["
184184
+ fileHash
185185
+ "]");
186-
187186
if (filesToProceed.size() == 1 && filesToRemove.isEmpty()) {
188187
// if only one file updates then its most likely from annotator. So we need to get
189188
// suggestions asap:
@@ -194,20 +193,16 @@ public static void updateCachedResultsForFiles(
194193
firstFile,
195194
() -> retrieveSuggestions(project, filesToProceed, filesToRemove));
196195
} else {
197-
198196
mapFile2Suggestions.putAll(retrieveSuggestions(project, filesToProceed, filesToRemove));
199197
}
200-
201198
} else if (!filesToRemove.isEmpty()) {
202199
info("Files to remove: " + filesToRemove.size() + " files: " + filesToRemove.toString());
203200
retrieveSuggestions(project, filesToProceed, filesToRemove);
204201
} else {
205202
warn("Nothing to update for " + psiFiles.size() + " files: " + psiFiles.toString());
206203
}
207-
208204
ServiceManager.getService(project, myTodoView.class).refresh();
209205
updateInProgress = false;
210-
211206
} finally {
212207
// if (filesToProceed != null && !filesToProceed.isEmpty())
213208
info("MUTEX RELEASED");

src/main/java/ai/deepcode/jbplugin/core/RunUtils.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ && getRunningIndicators(project).contains(prevProgressIndicator)) {
154154
+ "]");
155155
prevProgressIndicator.cancel();
156156
getRunningIndicators(project).remove(prevProgressIndicator);
157+
HashContentUtils.removeHashContent(psiFile);
157158
}
158159
getRunningIndicators(project).add(indicator);
159160

0 commit comments

Comments
 (0)