|
|
@@ -475,12 +475,19 @@ public class GC { |
|
|
|
// loose objects. Make a last check, though, to avoid deleting objects |
|
|
|
// that could have been referenced while the candidates list was being |
|
|
|
// built (by an incoming push, for example). |
|
|
|
Set<File> touchedFanout = new HashSet<>(); |
|
|
|
for (File f : deletionCandidates.values()) { |
|
|
|
if (f.lastModified() < expireDate) { |
|
|
|
f.delete(); |
|
|
|
touchedFanout.add(f.getParentFile()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
for (File f : touchedFanout) { |
|
|
|
FileUtils.delete(f, |
|
|
|
FileUtils.EMPTY_DIRECTORIES_ONLY | FileUtils.IGNORE_ERRORS); |
|
|
|
} |
|
|
|
|
|
|
|
repo.getObjectDatabase().close(); |
|
|
|
} |
|
|
|
|