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__);
|
tryLogCurrentException(__PRETTY_FUNCTION__);
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
std::vector<std::string> files;
|
else
|
||||||
try
|
|
||||||
{
|
{
|
||||||
disk->listFiles(from, files);
|
DirectoryIteratorPtr it;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
it = disk->iterateDirectory(from);
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
tryLogCurrentException(__PRETTY_FUNCTION__);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (; it->isValid(); it->next())
|
||||||
|
calculateTotalSizeOnDiskImpl(disk, fs::path(from) / it->name(), total_size);
|
||||||
}
|
}
|
||||||
catch (...)
|
|
||||||
{
|
|
||||||
tryLogCurrentException(__PRETTY_FUNCTION__);
|
|
||||||
}
|
|
||||||
for (const auto & file : files)
|
|
||||||
calculateTotalSizeOnDiskImpl(disk, fs::path(from) / file, total_size);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static UInt64 calculateTotalSizeOnDisk(const DiskPtr & disk, const String & from)
|
static UInt64 calculateTotalSizeOnDisk(const DiskPtr & disk, const String & from)
|
||||||
|
Loading…
Reference in New Issue
Block a user