Fixed: Prevent getting disk space from returning no information when it partially fails

(cherry picked from commit 2c65e4fa41418157d0d27b34c3bab80158cff219)
pull/3338/head
Mark McDowall 2 years ago committed by Qstick
parent c554c499a1
commit 8228f11345

@ -184,14 +184,32 @@ namespace NzbDrone.Mono.Disk
protected override List<IMount> GetAllMounts()
{
return _procMountProvider.GetMounts()
.Concat(GetDriveInfoMounts()
.Select(d => new DriveInfoMount(d, FindDriveType.Find(d.DriveFormat)))
.Where(d => d.DriveType == DriveType.Fixed ||
d.DriveType == DriveType.Network ||
d.DriveType == DriveType.Removable))
.DistinctBy(v => v.RootDirectory)
.ToList();
var mounts = new List<IMount>();
try
{
mounts.AddRange(_procMountProvider.GetMounts());
}
catch (Exception e)
{
_logger.Warn(e, $"Unable to get mounts: {e.Message}");
}
try
{
mounts.AddRange(GetDriveInfoMounts()
.Select(d => new DriveInfoMount(d, FindDriveType.Find(d.DriveFormat)))
.Where(d => d.DriveType == DriveType.Fixed ||
d.DriveType == DriveType.Network ||
d.DriveType == DriveType.Removable));
}
catch (Exception e)
{
_logger.Warn(e, $"Unable to get drive mounts: {e.Message}");
}
return mounts.DistinctBy(v => v.RootDirectory)
.ToList();
}
protected override bool IsSpecialMount(IMount mount)

Loading…
Cancel
Save