MCPcopy
hub / github.com/c-bata/kube-prompt / shouldFetch

Function shouldFetch

kube/resource.go:50–60  ·  view source on GitHub ↗
(key string)

Source from the content-addressed store, hash-verified

48)
49
50func shouldFetch(key string) bool {
51 v, ok := lastFetchedAt.Load(key)
52 if !ok {
53 return true
54 }
55 t, ok := v.(time.Time)
56 if !ok {
57 return true
58 }
59 return time.Since(t) > thresholdFetchInterval
60}
61
62func updateLastFetchedAt(key string) {
63 lastFetchedAt.Store(key, time.Now())

Callers 15

fetchComponentStatusListFunction · 0.85
fetchConfigMapListFunction · 0.85
fetchContextListFunction · 0.85
fetchPodsFunction · 0.85
fetchDaemonSetListFunction · 0.85
fetchDeploymentsFunction · 0.85
fetchEndpointsFunction · 0.85
fetchEventsFunction · 0.85
fetchNodeListFunction · 0.85
fetchSecretListFunction · 0.85
fetchIngressesFunction · 0.85
fetchLimitRangeListFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected