AnyActiveSince reports whether any key has activity after the provided cutoff.
(keys []string, cutoff time.Time)
| 215 | |
| 216 | // AnyActiveSince reports whether any key has activity after the provided cutoff. |
| 217 | func (st *Tracker) AnyActiveSince(keys []string, cutoff time.Time) bool { |
| 218 | st.mu.RLock() |
| 219 | defer st.mu.RUnlock() |
| 220 | |
| 221 | for _, key := range keys { |
| 222 | entry, exists := st.stats[key] |
| 223 | if !exists { |
| 224 | continue |
| 225 | } |
| 226 | if entry.LastActiveTime.After(cutoff) { |
| 227 | return true |
| 228 | } |
| 229 | } |
| 230 | |
| 231 | return false |
| 232 | } |
| 233 | |
| 234 | // EndpointActivity returns endpoint IP -> last seen unix timestamp for provided keys. |
| 235 | // If multiple keys share endpoint IP, the newest timestamp wins. |
no outgoing calls