Skip to content

Commit

Permalink
Merge branch 'develop' for release v5.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
epoupon committed Feb 4, 2023
2 parents 8ae7988 + 9c58327 commit aa6ffc4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/libs/share/impl/ShareCleaner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,16 @@ namespace Share
bool
ShareCleaner::isOrphanFile(const std::filesystem::path& filePath)
{
std::filesystem::path relativePath {std::filesystem::relative(filePath, _workingDirectory)};
const std::filesystem::path relativeFilePath {std::filesystem::relative(filePath, _workingDirectory)};
assert(!relativeFilePath.empty());

Wt::Dbo::Session& session {_db.getTLSSession()};
Wt::Dbo::Transaction transaction {session};

return !File::getByPath(session, relativePath.empty() ? filePath : relativePath);
FS_LOG(SHARE, DEBUG) << "Checking orphan file '" << filePath.string() << "', relative file path = '" << relativeFilePath.string() << "'";

return !File::getByPath(session, relativeFilePath)
&& !File::getByPath(session, filePath);
}

void
Expand Down

0 comments on commit aa6ffc4

Please sign in to comment.