Delete removes session from store.
(s *Session)
| 178 | |
| 179 | // Delete removes session from store. |
| 180 | func (ss *SessionStore) Delete(s *Session) { |
| 181 | ss.lock.Lock() |
| 182 | defer ss.lock.Unlock() |
| 183 | |
| 184 | delete(ss.sessCache, s.sid) |
| 185 | if s.proto == LPOLL { |
| 186 | ss.lru.Remove(s.lpTracker) |
| 187 | } |
| 188 | |
| 189 | statsSet("LiveSessions", int64(len(ss.sessCache))) |
| 190 | } |
| 191 | |
| 192 | // Range calls given function for all sessions. It stops if the function returns false. |
| 193 | func (ss *SessionStore) Range(f func(sid string, s *Session) bool) { |