cache smartctl scan results for 10 min w/ force option

also add support for sntrealtek
This commit is contained in:
henrygd
2025-10-28 14:01:45 -04:00
parent 9a9a89ee50
commit 783ed9f456
3 changed files with 37 additions and 35 deletions

View File

@@ -168,7 +168,7 @@ func (h *GetSmartDataHandler) Handle(hctx *HandlerContext) error {
// return empty map to indicate no data
return hctx.SendResponse(map[string]smart.SmartData{}, hctx.RequestID)
}
if err := hctx.Agent.smartManager.Refresh(); err != nil {
if err := hctx.Agent.smartManager.Refresh(false); err != nil {
slog.Debug("smart refresh failed", "err", err)
}
data := hctx.Agent.smartManager.GetCurrentData()