AllChangesIndexer: Don't abort when failing to open repository
Previously when opening project repositories during the reindexing process, the program would be aborted if it failed to open the repository. Instead, just log an error message and continue with remaining projects. Change-Id: I571dec2639f8f22bde0ec0460304a1f27f8d8fe9
This commit is contained in:
committed by
David Pursehouse
parent
0d9927c858
commit
83eaad4232
@@ -118,15 +118,13 @@ public class AllChangesIndexer extends SiteIndexer<Change.Id, ChangeData, Change
|
||||
pm.beginTask("Collecting projects", ProgressMonitor.UNKNOWN);
|
||||
SortedSet<ProjectHolder> projects = new TreeSet<>();
|
||||
int changeCount = 0;
|
||||
Stopwatch sw = Stopwatch.createStarted();
|
||||
for (Project.NameKey name : projectCache.all()) {
|
||||
try (Repository repo = repoManager.openRepository(name)) {
|
||||
int size = ChangeNotes.Factory.scan(repo).size();
|
||||
changeCount += size;
|
||||
projects.add(new ProjectHolder(name, size));
|
||||
} catch (IOException e) {
|
||||
log.error("Error collecting projects", e);
|
||||
return new Result(sw, false, 0, 0);
|
||||
log.error("Error collecting changes for project {}", name, e);
|
||||
}
|
||||
pm.update(1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user