Even less directories

This commit is contained in:
Alexey Milovidov 2024-04-27 19:13:17 +02:00
parent 089cc25d9b
commit 6a083ebed0
3 changed files with 2 additions and 7 deletions

View File

@ -249,9 +249,6 @@ void LocalServer::tryInitPath()
LOG_DEBUG(log, "Working directory created: {}", path);
}
fs::create_directories(fs::path(path) / "data" / "");
fs::create_directories(fs::path(path) / "metadata" / "");
global_context->setPath(fs::path(path) / "");
global_context->setTemporaryStoragePath(fs::path(path) / "tmp" / "", 0);

View File

@ -224,7 +224,7 @@ static UInt64 getTotalSpaceByName(const String & name, const String & disk_path,
{
struct statvfs fs;
if (name == "default") /// for default disk we get space from path/data/
fs = getStatVFS((fs::path(disk_path) / "data/").string());
fs = getStatVFS((fs::path(disk_path) / "data" / "").string());
else
fs = getStatVFS(disk_path);
UInt64 total_size = fs.f_blocks * fs.f_frsize;
@ -248,7 +248,7 @@ std::optional<UInt64> DiskLocal::getAvailableSpace() const
/// available for superuser only and for system purposes
struct statvfs fs;
if (name == "default") /// for default disk we get space from path/data/
fs = getStatVFS((fs::path(disk_path) / "data/").string());
fs = getStatVFS((fs::path(disk_path) / "data" / "").string());
else
fs = getStatVFS(disk_path);
UInt64 total_size = fs.f_bavail * fs.f_frsize;

View File

@ -1091,9 +1091,7 @@ void Context::setTemporaryStoragePath(const String & path, size_t max_size)
VolumePtr volume = createLocalSingleDiskVolume(shared->tmp_path, shared->getConfigRefWithLock(lock));
for (const auto & disk : volume->getDisks())
{
setupTmpPath(shared->log, disk->getPath());
}
TemporaryDataOnDiskSettings temporary_data_on_disk_settings;
temporary_data_on_disk_settings.max_size_on_disk = max_size;