Revert "AllChangesIndexer: Don't abort when failing to open repository"

This was done differently on stable-2.15 with change I282ddae9a.

Revert this so we can more easily backport the other implementation.

This reverts commit 83eaad4232.

Change-Id: I5300ba11dbe5da2dd34a70f3b57cb488bbc3a1ca
This commit is contained in:
David Pursehouse
2018-05-17 13:40:51 +09:00
parent 45b4c87a7c
commit ef899cc67a

View File

@@ -118,13 +118,15 @@ 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 changes for project {}", name, e);
log.error("Error collecting projects", e);
return new Result(sw, false, 0, 0);
}
pm.update(1);
}