cleanupExpiredSessions 清理过期会话
()
| 996 | |
| 997 | // cleanupExpiredSessions 清理过期会话 |
| 998 | func (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 清理过期缓存 |
| 1012 | func (ac *AccessController) cleanupExpiredCache() { |
no test coverage detected