(id string)
| 372 | } |
| 373 | |
| 374 | func (s *Server) sessionInitialized(id string) bool { |
| 375 | s.mu.Lock() |
| 376 | defer s.mu.Unlock() |
| 377 | currentSession, ok := s.sessions[id] |
| 378 | if !ok || currentSession == nil { |
| 379 | return false |
| 380 | } |
| 381 | now := time.Now() |
| 382 | if sessionExpired(currentSession, now) { |
| 383 | delete(s.sessions, id) |
| 384 | return false |
| 385 | } |
| 386 | currentSession.lastUsedAt = now |
| 387 | return currentSession.initialized |
| 388 | } |
| 389 | |
| 390 | func (s *Server) deleteSession(id string) { |
| 391 | s.mu.Lock() |
no test coverage detected