Skip to content

Commit

Permalink
Fix Store.GetSessionID concurrency reads
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergio Andres Virviescas Santana committed Aug 25, 2020
1 parent 7c60ca9 commit 94b38db
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion store.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ func (s *Store) Flush() {

// GetSessionID returns the session id
func (s *Store) GetSessionID() []byte {
return s.sessionID
s.lock.RLock()
id := s.sessionID
s.lock.RUnlock()

return id
}

// SetSessionID sets the session id
Expand Down

0 comments on commit 94b38db

Please sign in to comment.