mirror of
https://github.com/LibreOffice/online.git
synced 2025-08-20 16:39:17 +00:00
wsd: faster jail directory cleanup
Around 1.5x faster than Poco, which first enumerates files into a container, then iterates over them and stats before unlinking. Here we enumerate and unlink in a single pass. Change-Id: I79d1c0f1b5ec557ccc4f0e2ec7a0609051d8d212 Reviewed-on: https://gerrit.libreoffice.org/33680 Reviewed-by: Ashod Nakashian <ashnakash@gmail.com> Tested-by: Ashod Nakashian <ashnakash@gmail.com>
This commit is contained in:

committed by
Ashod Nakashian

parent
65be8a3e56
commit
0d4d506ea3
@ -63,17 +63,7 @@ namespace FileUtil
|
||||
/// Supresses exception when the file is already removed.
|
||||
/// This can happen when there is a race (unavoidable) or when
|
||||
/// we don't care to check before we remove (when no race exists).
|
||||
inline void removeFile(const std::string& path, const bool recursive = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
Poco::File(path).remove(recursive);
|
||||
}
|
||||
catch (const std::exception&)
|
||||
{
|
||||
// Already removed or we don't care about failures.
|
||||
}
|
||||
}
|
||||
void removeFile(const std::string& path, const bool recursive = false);
|
||||
|
||||
inline void removeFile(const Poco::Path& path, const bool recursive = false)
|
||||
{
|
||||
|
Reference in New Issue
Block a user