Lower required tmp dir size to 512MiB (#15098)
This commit is contained in:
@@ -14,7 +14,7 @@ public static class StorageHelper
|
|||||||
{
|
{
|
||||||
private const long TwoGigabyte = 2_147_483_647L;
|
private const long TwoGigabyte = 2_147_483_647L;
|
||||||
private const long FiveHundredAndTwelveMegaByte = 536_870_911L;
|
private const long FiveHundredAndTwelveMegaByte = 536_870_911L;
|
||||||
private static readonly string[] _byteHumanizedSuffixes = ["B", "KB", "MB", "GB", "TB", "PB", "EB"];
|
private static readonly string[] _byteHumanizedSuffixes = ["B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB"];
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Tests the available storage capacity on the jellyfin paths with estimated minimum values.
|
/// Tests the available storage capacity on the jellyfin paths with estimated minimum values.
|
||||||
@@ -27,7 +27,7 @@ public static class StorageHelper
|
|||||||
TestDataDirectorySize(applicationPaths.LogDirectoryPath, logger, FiveHundredAndTwelveMegaByte);
|
TestDataDirectorySize(applicationPaths.LogDirectoryPath, logger, FiveHundredAndTwelveMegaByte);
|
||||||
TestDataDirectorySize(applicationPaths.CachePath, logger, TwoGigabyte);
|
TestDataDirectorySize(applicationPaths.CachePath, logger, TwoGigabyte);
|
||||||
TestDataDirectorySize(applicationPaths.ProgramDataPath, logger, TwoGigabyte);
|
TestDataDirectorySize(applicationPaths.ProgramDataPath, logger, TwoGigabyte);
|
||||||
TestDataDirectorySize(applicationPaths.TempDirectory, logger, TwoGigabyte);
|
TestDataDirectorySize(applicationPaths.TempDirectory, logger, FiveHundredAndTwelveMegaByte);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -77,7 +77,7 @@ public static class StorageHelper
|
|||||||
var drive = new DriveInfo(path);
|
var drive = new DriveInfo(path);
|
||||||
if (threshold != -1 && drive.AvailableFreeSpace < threshold)
|
if (threshold != -1 && drive.AvailableFreeSpace < threshold)
|
||||||
{
|
{
|
||||||
throw new InvalidOperationException($"The path `{path}` has insufficient free space. Required: at least {HumanizeStorageSize(threshold)}.");
|
throw new InvalidOperationException($"The path `{path}` has insufficient free space. Available: {HumanizeStorageSize(drive.AvailableFreeSpace)}, Required: {HumanizeStorageSize(threshold)}.");
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.LogInformation(
|
logger.LogInformation(
|
||||||
|
|||||||
Reference in New Issue
Block a user