(userID uint)
| 426 | } |
| 427 | |
| 428 | func (s *Server) countUserSessionsLocked(userID uint) int { |
| 429 | count := 0 |
| 430 | for _, currentSession := range s.sessions { |
| 431 | if currentSession != nil && currentSession.userID == userID { |
| 432 | count++ |
| 433 | } |
| 434 | } |
| 435 | return count |
| 436 | } |
| 437 | |
| 438 | func (s *Server) pruneLeastRecentlyUsedUserSessionsLocked(userID uint, count int) { |
| 439 | for range count { |