fix: Too many non-blocking read actions submitted at once fixed #83

This commit is contained in:
林万程
2025-11-30 14:43:40 +08:00
parent bf98f3e5c9
commit ebffbc4b16

View File

@@ -25,6 +25,10 @@ public class TaskUtils {
taskMap.computeIfAbsent(project,
project1 -> AppExecutorUtil.getAppScheduledExecutorService().scheduleWithFixedDelay(() -> {
try {
T t = cache.get(project);
if (t == null) {
return;
}
ReadAction.nonBlocking(() -> {
if (project.isDisposed()) {
cache.remove(project);
@@ -34,13 +38,10 @@ public class TaskUtils {
}
return;
}
T t = cache.get(project);
if (t == null) {
return;
}
func.accept(t);
})
.inSmartMode(project)
.coalesceBy(t)
.submit(AppExecutorUtil.getAppExecutorService());
} catch (ProcessCanceledException ignored) {
} catch (Throwable e) {