Do session disk writes in a new goroutine

This commit is contained in:
Ken-Håvard Lieng 2018-06-01 04:47:11 +02:00
parent e0200a2b2a
commit e8f5809940

View File

@ -293,7 +293,7 @@ func (s *stateStore) setSession(session *session.Session) {
s.lock.Lock()
s.sessions[session.Key()] = session
s.lock.Unlock()
s.sessionStore.SaveSession(session)
go s.sessionStore.SaveSession(session)
}
func (s *stateStore) deleteSession(key string) {
@ -319,5 +319,5 @@ func (s *stateStore) deleteSession(key string) {
state.user.Remove()
}
s.sessionStore.DeleteSession(key)
go s.sessionStore.DeleteSession(key)
}