MCPcopy Create free account
hub / github.com/PasarGuard/node / AnyActiveSince

Method AnyActiveSince

pkg/stats/tracker.go:217–232  ·  view source on GitHub ↗

AnyActiveSince reports whether any key has activity after the provided cutoff.

(keys []string, cutoff time.Time)

Source from the content-addressed store, hash-verified

215
216// AnyActiveSince reports whether any key has activity after the provided cutoff.
217func (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.

Callers 2

GetUserOnlineStatsMethod · 0.80

Calls

no outgoing calls

Tested by 1