Skip to content

Commit

Permalink
XrdApps::JCache: remove also the parent directory of journal files
Browse files Browse the repository at this point in the history
  • Loading branch information
apeters1971 committed Jun 11, 2024
1 parent a5e5d38 commit 2a2647b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/XrdApps/XrdClJCachePlugin/cleaner/Cleaner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@ void Cleaner::cleanDirectory(const fs::path &directory, long long highWatermark,
try {
fs::remove(filePath);
currentSize -= fileSize;
fs::path parentDir = filePath.parent_path();
std::error_code ec;
fs::remove_all(parentDir, ec);
if (ec) {
mLog->Error(1, "JCache::Cleaner: error deleting directory '%s'", parentDir.c_str());
}
mLog->Info(1, "JCache:Cleaner : deleted '%s' (Size: %lu bytes)", filePath.c_str(),
fileSize);
} catch (const std::exception &e) {
Expand Down

0 comments on commit 2a2647b

Please sign in to comment.