Skip to content

Commit 0f4d205

Browse files
committed
improve logging for various history cache events
1 parent c4e2751 commit 0f4d205

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

opengrok-indexer/src/main/java/org/opengrok/indexer/history/HistoryGuru.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,14 @@ public Collection<RepositoryInfo> getRepositories() {
10091009
*/
10101010
public void storeHistory(File file, History history) {
10111011
Repository repository = getRepository(file);
1012+
if (Objects.isNull(repository)) {
1013+
LOGGER.warning(() -> String.format("failed to get repository for '%s'", launderLog(file.toString())));
1014+
return;
1015+
}
1016+
10121017
if (repository.hasHistoryForDirectories()) {
1018+
LOGGER.finer(() -> String.format("repository %s supports history for directories, skipping '%s'",
1019+
repository, launderLog(file.toString())));
10131020
return;
10141021
}
10151022

@@ -1064,14 +1071,15 @@ private Map<Repository, Optional<Exception>> createHistoryCacheReal(Collection<R
10641071
try {
10651072
latestRev = historyCache.getLatestCachedRevision(repo);
10661073
repos2process.put(repo, latestRev);
1074+
LOGGER.finest(() -> String.format("latest cached revision %s for repository %s", latestRev, repo));
10671075
} catch (CacheException he) {
10681076
LOGGER.log(Level.WARNING, String.format("Failed to retrieve latest cached revision for %s", repo), he);
10691077
}
10701078
}
10711079

10721080
LOGGER.log(Level.INFO, "Creating history cache for {0} repositories", repos2process.size());
10731081
Map<Repository, Future<Optional<Exception>>> futures = new HashMap<>();
1074-
try (Progress progress = new Progress(LOGGER, "repository invalidation", repos2process.size())) {
1082+
try (Progress progress = new Progress(LOGGER, "history cache", repos2process.size())) {
10751083
for (final Map.Entry<Repository, String> entry : repos2process.entrySet()) {
10761084
futures.put(entry.getKey(), executor.submit(() -> {
10771085
try {

0 commit comments

Comments
 (0)