Make _lastUpdate per storagedevice, not static. (#2024)

Otherwise throttling will only enable 1 drive per cycle to update, always the first.
This commit is contained in:
Rémi Mercier
2025-11-11 10:38:27 +01:00
committed by GitHub
parent 898c441d9f
commit 1ce2d63bd5
@@ -32,7 +32,7 @@ public sealed class StorageDevice : Hardware, ISmart
private long _lastTime;
private long _lastWriteCount;
private static DateTime _lastUpdate;
private DateTime _lastUpdate = DateTime.MinValue;
private readonly List<StorageDeviceSensor> _sensors = new();
@@ -84,9 +84,6 @@ public sealed class StorageDevice : Hardware, ISmart
//Update usage sensors
UpdateUsageSensor();
//Update general sensors
_sensors.ForEach(s => s.Update(_storage));
//Update attributes
foreach (var attribute in _storage.Smart.SmartAttributes)
{
@@ -99,6 +96,9 @@ public sealed class StorageDevice : Hardware, ISmart
found.Attribute = attribute;
}
}
//Update general sensors
_sensors.ForEach(s => s.Update(_storage));
}
public override string GetReport()