mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-16 03:12:43 +00:00
better
This commit is contained in:
parent
330777a0cc
commit
61563d4f19
@ -44,19 +44,22 @@ static void calculateTotalSizeOnDiskImpl(const DiskPtr & disk, const String & fr
|
||||
{
|
||||
tryLogCurrentException(__PRETTY_FUNCTION__);
|
||||
}
|
||||
return;
|
||||
}
|
||||
std::vector<std::string> files;
|
||||
else
|
||||
{
|
||||
DirectoryIteratorPtr it;
|
||||
try
|
||||
{
|
||||
disk->listFiles(from, files);
|
||||
it = disk->iterateDirectory(from);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
tryLogCurrentException(__PRETTY_FUNCTION__);
|
||||
}
|
||||
for (const auto & file : files)
|
||||
calculateTotalSizeOnDiskImpl(disk, fs::path(from) / file, total_size);
|
||||
|
||||
for (; it->isValid(); it->next())
|
||||
calculateTotalSizeOnDiskImpl(disk, fs::path(from) / it->name(), total_size);
|
||||
}
|
||||
}
|
||||
|
||||
static UInt64 calculateTotalSizeOnDisk(const DiskPtr & disk, const String & from)
|
||||
|
Loading…
Reference in New Issue
Block a user