MCPcopy Create free account
hub / github.com/astercloud/aster / cleanupExpiredSessions

Method cleanupExpiredSessions

pkg/security/access_control.go:998–1009  ·  view source on GitHub ↗

cleanupExpiredSessions 清理过期会话

()

Source from the content-addressed store, hash-verified

996
997// cleanupExpiredSessions 清理过期会话
998func (ac *AccessController) cleanupExpiredSessions() {
999 ac.mu.Lock()
1000 defer ac.mu.Unlock()
1001
1002 now := time.Now()
1003 for sessionID, session := range ac.sessions {
1004 if now.After(session.ExpiresAt) {
1005 session.Status = SessionStatusExpired
1006 delete(ac.sessions, sessionID)
1007 }
1008 }
1009}
1010
1011// cleanupExpiredCache 清理过期缓存
1012func (ac *AccessController) cleanupExpiredCache() {

Callers 1

startCleanupWorkerMethod · 0.95

Calls 1

deleteFunction · 0.85

Tested by

no test coverage detected