MCPcopy
hub / github.com/cortexlabs/cortex / findStaleCachedErrors

Function findStaleCachedErrors

pkg/lib/telemetry/error_cache.go:105–123  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

103}
104
105func findStaleCachedErrors() strset.Set {
106 _errorCache.RLock()
107 defer _errorCache.RUnlock()
108
109 if time.Since(_errorCache.lastCleanup) < _cacheCleanupInterval {
110 return nil
111 }
112
113 _errorCache.lastCleanup = time.Now()
114
115 staleErrorMessages := strset.New()
116 for errMsg, errStatus := range _errorCache.m {
117 if time.Since(errStatus.LastSeenTime) > _cacheEvictionPeriod {
118 staleErrorMessages.Add(errMsg)
119 }
120 }
121
122 return staleErrorMessages
123}

Callers 1

cleanupCacheFunction · 0.85

Calls 2

NewFunction · 0.92
AddMethod · 0.45

Tested by

no test coverage detected