Added comments, clean-up

This commit is contained in:
cake
2025-10-29 22:54:50 +01:00
parent c37e3badf1
commit 7c4d0fd5e9
4 changed files with 45 additions and 39 deletions

View File

@@ -409,11 +409,17 @@ public sealed class CacheMonitor : DisposableMediatorSubscriberBase
return;
}
FileCacheSize = -1;
DriveInfo di = new(new DirectoryInfo(_configService.Current.CacheFolder).Root.FullName);
FileCacheSize = -1;
var drive = DriveInfo.GetDrives().FirstOrDefault(d => _configService.Current.CacheFolder.StartsWith(d.Name, StringComparison.Ordinal));
if (drive == null)
{
return;
}
try
{
FileCacheDriveFree = di.AvailableFreeSpace;
FileCacheDriveFree = drive.AvailableFreeSpace;
}
catch (Exception ex)
{