From e8f5809940d513b2ac950aaf23ee81b6686b72ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ken-H=C3=A5vard=20Lieng?= Date: Fri, 1 Jun 2018 04:47:11 +0200 Subject: [PATCH] Do session disk writes in a new goroutine --- server/state.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/state.go b/server/state.go index 49590e3c..bb80a778 100644 --- a/server/state.go +++ b/server/state.go @@ -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) }