mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-219033 - artifact added to index if it exists in local repo and not present in index - removed queue
GitOrigin-RevId: f6ee75b6b74d3ba0feb649ce9698c977d4704fac
This commit is contained in:
committed by
intellij-monorepo-bot
parent
da7188a4b5
commit
3c797d00cf
+11
-8
@@ -13,8 +13,6 @@ import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.util.JdomKt;
|
||||
import com.intellij.util.io.PathKt;
|
||||
import com.intellij.util.ui.update.MergingUpdateQueue;
|
||||
import com.intellij.util.ui.update.Update;
|
||||
import gnu.trove.THashSet;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.JDOMException;
|
||||
@@ -432,14 +430,19 @@ public class MavenIndicesManager implements Disposable {
|
||||
|
||||
|
||||
private static class IndexFixer {
|
||||
private final MergingUpdateQueue myMergingUpdateQueue =
|
||||
new MergingUpdateQueue(this.getClass().getName(), 1000, true, MergingUpdateQueue.ANY_COMPONENT, null, null, false);
|
||||
private final static Set<String> INDEXED = Collections.newSetFromMap(new WeakHashMap<>());
|
||||
|
||||
public void fixIndex(File file, MavenIndex index) {
|
||||
myMergingUpdateQueue.queue(new Update(file.getPath()) {
|
||||
@Override
|
||||
public void run() {
|
||||
index.addArtifact(file);
|
||||
synchronized (INDEXED) {
|
||||
if (INDEXED.contains(file.getName())) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
ApplicationManager.getApplication().executeOnPooledThread(() -> {
|
||||
index.addArtifact(file);
|
||||
synchronized (INDEXED) {
|
||||
INDEXED.add(file.getName());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user