From 68a83c7862539fd9bf8876f58bd5942366050044 Mon Sep 17 00:00:00 2001 From: Tw93 Date: Sat, 21 Mar 2026 16:06:55 +0800 Subject: [PATCH] fix(status): cache Finder probe failures to avoid repeated timeout --- cmd/status/metrics_disk.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/status/metrics_disk.go b/cmd/status/metrics_disk.go index 39a0a9d..b934c8a 100644 --- a/cmd/status/metrics_disk.go +++ b/cmd/status/metrics_disk.go @@ -332,6 +332,9 @@ func getFinderStartupDiskFreeBytes() (free, total uint64, err error) { out, err := runCmd(ctx, "osascript", "-e", `tell application "Finder" to return {free space of startup disk, capacity of startup disk}`) if err != nil { + // Cache the failure timestamp so repeated calls within diskCacheTTL + // return immediately instead of each waiting the full 5s timeout. + finderDiskCachedAt = time.Now() return 0, 0, err }