MCPcopy Create free account
hub / github.com/crewjam/saml / dropExpired

Method dropExpired

samlsp/session_revocation.go:357–371  ·  view source on GitHub ↗

dropExpired removes the records whose expiry is before now. It does nothing before nextExpiry, so a store full of unexpired records is not scanned on every call.

(now time.Time)

Source from the content-addressed store, hash-verified

355// nothing before nextExpiry, so a store full of unexpired records is not
356// scanned on every call.
357func (s *MemorySessionRevocationStore) dropExpired(now time.Time) {
358 if !s.nextExpiry.IsZero() && !now.After(s.nextExpiry) {
359 return
360 }
361 s.nextExpiry = time.Time{}
362 for key, entry := range s.entries {
363 if now.After(entry.expiresAt) {
364 delete(s.entries, key)
365 continue
366 }
367 if s.nextExpiry.IsZero() || entry.expiresAt.Before(s.nextExpiry) {
368 s.nextExpiry = entry.expiresAt
369 }
370 }
371}

Callers 1

RevokeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected