Create directory before checking for size (#13962)

This commit is contained in:
JPVenson 2025-04-26 18:30:57 +03:00 committed by GitHub
parent 8ee358de2c
commit 2ea7af777b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -72,6 +72,11 @@ public static class StorageHelper
private static void TestDataDirectorySize(string path, ILogger logger, long threshold = -1) private static void TestDataDirectorySize(string path, ILogger logger, long threshold = -1)
{ {
logger.LogDebug("Check path {TestPath} for storage capacity", path); logger.LogDebug("Check path {TestPath} for storage capacity", path);
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
var drive = new DriveInfo(path); var drive = new DriveInfo(path);
if (threshold != -1 && drive.AvailableFreeSpace < threshold) if (threshold != -1 && drive.AvailableFreeSpace < threshold)
{ {