Shutdown terminates sessionStore. No need to clean up. Don't send to clustered sessions, their servers are not being shut down.
()
| 203 | // Shutdown terminates sessionStore. No need to clean up. |
| 204 | // Don't send to clustered sessions, their servers are not being shut down. |
| 205 | func (ss *SessionStore) Shutdown() { |
| 206 | ss.lock.Lock() |
| 207 | defer ss.lock.Unlock() |
| 208 | |
| 209 | shutdown := NoErrShutdown(types.TimeNow()) |
| 210 | for _, s := range ss.sessCache { |
| 211 | if !s.isMultiplex() { |
| 212 | _, data := s.serialize(shutdown) |
| 213 | s.stopSession(data) |
| 214 | } |
| 215 | } |
| 216 | |
| 217 | // TODO: Consider broadcasting shutdown to other cluster nodes. |
| 218 | |
| 219 | logs.Info.Println("SessionStore shut down, sessions terminated:", len(ss.sessCache)) |
| 220 | } |
| 221 | |
| 222 | // EvictUser terminates all sessions of a given user. |
| 223 | func (ss *SessionStore) EvictUser(uid types.Uid, skipSid string) { |
no test coverage detected