(key string)
| 48 | ) |
| 49 | |
| 50 | func 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 | |
| 62 | func updateLastFetchedAt(key string) { |
| 63 | lastFetchedAt.Store(key, time.Now()) |
no outgoing calls
no test coverage detected