mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[vcs-log] schedule reindexing on pce
This commit is contained in:
+15
-3
@@ -500,13 +500,13 @@ public class VcsLogPersistentIndex implements VcsLogIndex, Disposable {
|
||||
indicator.checkCanceled();
|
||||
}
|
||||
catch (ProcessCanceledException reThrown) {
|
||||
taskCompleted(null);
|
||||
throw reThrown;
|
||||
}
|
||||
catch (Throwable t) {
|
||||
LOG.error("Error while indexing", t);
|
||||
}
|
||||
}
|
||||
|
||||
taskCompleted(null);
|
||||
}
|
||||
};
|
||||
@@ -555,10 +555,13 @@ public class VcsLogPersistentIndex implements VcsLogIndex, Disposable {
|
||||
indexOneByOne(commits, counter);
|
||||
}
|
||||
}
|
||||
catch (ProcessCanceledException e) {
|
||||
scheduleReindex();
|
||||
throw e;
|
||||
}
|
||||
catch (VcsException e) {
|
||||
LOG.error(e);
|
||||
commits.forEach(value -> markForIndexing(value, myRoot));
|
||||
scheduleIndex(false);
|
||||
scheduleReindex();
|
||||
}
|
||||
}
|
||||
finally {
|
||||
@@ -580,6 +583,15 @@ public class VcsLogPersistentIndex implements VcsLogIndex, Disposable {
|
||||
}
|
||||
}
|
||||
|
||||
private void scheduleReindex() {
|
||||
LOG.debug("Schedule reindexing of " + myCommits.size() + " commits in " + myRoot.getName());
|
||||
myCommits.forEach(value -> {
|
||||
markForIndexing(value, myRoot);
|
||||
return true;
|
||||
});
|
||||
scheduleIndex(false);
|
||||
}
|
||||
|
||||
private void indexOneByOne(@NotNull IntStream commits, @NotNull CommitsCounter counter) throws VcsException {
|
||||
// We pass hashes to VcsLogProvider#readFullDetails in batches
|
||||
// in order to avoid allocating too much memory for these hashes
|
||||
|
||||
Reference in New Issue
Block a user