mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
shared index: invalidate indexes & recover if chunks.zip is corrupted
GitOrigin-RevId: bbc11c601e3fe9ac6cc8c2bb16bb4bbe78a2a2dd
This commit is contained in:
committed by
intellij-monorepo-bot
parent
53ce54df5c
commit
e5cfe0b2cb
+5
-1
@@ -99,7 +99,11 @@ class FileBasedIndexDataInitialization extends IndexInfrastructure.DataInitializ
|
||||
|
||||
currentVersionCorrupted = CorruptionMarker.invalidateIndexesIfNeeded();
|
||||
|
||||
FileBasedIndexInfrastructureExtension.EP_NAME.extensions().forEach(ex -> ex.initialize());
|
||||
for (FileBasedIndexInfrastructureExtension ex : FileBasedIndexInfrastructureExtension.EP_NAME.getExtensions()) {
|
||||
FileBasedIndexInfrastructureExtension.InitializationResult result = ex.initialize();
|
||||
currentVersionCorrupted = currentVersionCorrupted &&
|
||||
result == FileBasedIndexInfrastructureExtension.InitializationResult.INDEX_REBUILD_REQUIRED;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+6
-1
@@ -81,7 +81,8 @@ public interface FileBasedIndexInfrastructureExtension {
|
||||
* This method and {@link FileBasedIndexInfrastructureExtension#shutdown()} synchronize
|
||||
* lifecycle of an extension with {@link FileBasedIndexImpl}.
|
||||
**/
|
||||
void initialize();
|
||||
@NotNull
|
||||
InitializationResult initialize();
|
||||
|
||||
/**
|
||||
* Executed when IntelliJ is shutting down it's indexes (IDE shutdown or plugin load/unload). It is the best time
|
||||
@@ -97,4 +98,8 @@ public interface FileBasedIndexInfrastructureExtension {
|
||||
* all indexed data should be invalidate and full index rebuild will be requested
|
||||
*/
|
||||
int getVersion();
|
||||
|
||||
enum InitializationResult {
|
||||
SUCCESSFULLY, INDEX_REBUILD_REQUIRED
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user