Skip to content

Commit 5e1eac9

Browse files
author
Vladimir Kotal
authored
handle delete failure in FileHistoryCache (#3819)
* handle delete failure * fix wording
1 parent 8dbee6e commit 5e1eac9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -813,9 +813,13 @@ public void clear(Repository repository) {
813813
String revPath = getRepositoryCachedRevPath(repository);
814814
if (revPath != null) {
815815
// remove the file cached last revision (done separately in case
816-
// it gets ever moved outside of the hierarchy)
816+
// it gets ever moved outside the hierarchy)
817817
File cachedRevFile = new File(revPath);
818-
cachedRevFile.delete();
818+
try {
819+
Files.delete(cachedRevFile.toPath());
820+
} catch (IOException e) {
821+
LOGGER.log(Level.WARNING, String.format("failed to delete '%s'", cachedRevFile), e);
822+
}
819823
}
820824

821825
String histDir = getRepositoryHistDataDirname(repository);

0 commit comments

Comments
 (0)