mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
flush cached libraries info upon shutdown
This commit is contained in:
@@ -22,6 +22,7 @@ import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.progress.ProgressIndicator;
|
||||
import com.intellij.openapi.progress.ProgressManager;
|
||||
import com.intellij.openapi.util.NotNullLazyValue;
|
||||
import com.intellij.openapi.util.ShutDownTracker;
|
||||
import com.intellij.openapi.util.io.FileAttributes;
|
||||
import com.intellij.openapi.util.io.FileSystemUtil;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
@@ -263,9 +264,20 @@ public class JarHandler extends ZipHandler {
|
||||
FlushingDaemon.everyFiveSeconds(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (ourCachedLibraryInfo.isDirty()) ourCachedLibraryInfo.force();
|
||||
flushCachedLibraryInfos();
|
||||
}
|
||||
});
|
||||
|
||||
ShutDownTracker.getInstance().registerShutdownTask(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
flushCachedLibraryInfos();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private static void flushCachedLibraryInfos() {
|
||||
if (ourCachedLibraryInfo.isDirty()) ourCachedLibraryInfo.force();
|
||||
}
|
||||
|
||||
private CacheLibraryInfo(@NotNull String path, long time, long length) {
|
||||
|
||||
Reference in New Issue
Block a user