MCPcopy
hub / github.com/tinode/chat / Delete

Method Delete

server/sessionstore.go:180–190  ·  view source on GitHub ↗

Delete removes session from store.

(s *Session)

Source from the content-addressed store, hash-verified

178
179// Delete removes session from store.
180func (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.
193func (ss *SessionStore) Range(f func(sid string, s *Session) bool) {

Callers

nothing calls this directly

Calls 4

statsSetFunction · 0.85
LockMethod · 0.80
UnlockMethod · 0.80
RemoveMethod · 0.65

Tested by

no test coverage detected