From 72e0d1a1e31860b736582ebefedbd0927473a281 Mon Sep 17 00:00:00 2001 From: Ravi Pina Date: Mon, 15 Jun 2026 15:11:02 -0700 Subject: [PATCH] feat: relabel show api status cache section to Local Cache Data Rename the footer to make clear it reports on-disk cached data, not connectivity, and append each cache's age. --- cmd/show_api_status.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/cmd/show_api_status.go b/cmd/show_api_status.go index d9ac1b8..32696db 100644 --- a/cmd/show_api_status.go +++ b/cmd/show_api_status.go @@ -108,16 +108,21 @@ func runShowAPIStatus(cmd *cobra.Command, args []string) error { fmt.Println() } - // Show cache status if available + // Local cache data is the on-disk cached state, independent of whether the API + // is reachable (see per-API Status above). A down API still has usable cache. if cacheMgr != nil { - fmt.Println("Cache Status:") + fmt.Println("Local Cache Data:") for _, status := range statuses { cacheStatus, err := cacheMgr.VerifyAPICache(status.Label) if err != nil { fmt.Printf(" %s: error (%v)\n", status.Label, err) - } else { - fmt.Printf(" %s: %s\n", status.Label, cacheStatus.String()) + continue } + line := cacheStatus.String() + if cache, cerr := cacheMgr.GetAPICache(status.Label); cerr == nil && !cache.Meta.LastRefresh.IsZero() { + line += fmt.Sprintf(" (%s old)", formatDuration(time.Since(cache.Meta.LastRefresh))) + } + fmt.Printf(" %s: %s\n", status.Label, line) } }