File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
server/memorystore/providers/inmemory/stores Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ type SessionEntry struct {
2424// SessionStore struct to store the env variables
2525type SessionStore struct {
2626 wg sync.WaitGroup
27- mutex sync.RWMutex
27+ mutex sync.Mutex
2828 store map [string ]* SessionEntry
2929 // stores expireTime: key to remove data when cache is full
3030 // map is sorted by key so older most entry can be deleted first
@@ -35,7 +35,7 @@ type SessionStore struct {
3535// NewSessionStore create a new session store
3636func NewSessionStore () * SessionStore {
3737 store := & SessionStore {
38- mutex : sync.RWMutex {},
38+ mutex : sync.Mutex {},
3939 store : make (map [string ]* SessionEntry ),
4040 keyIndex : make (map [int64 ]string ),
4141 stop : make (chan struct {}),
@@ -71,8 +71,8 @@ func (s *SessionStore) clean() {
7171
7272// Get returns the value of the key in state store
7373func (s * SessionStore ) Get (key , subKey string ) string {
74- s .mutex .RLock ()
75- defer s .mutex .RUnlock ()
74+ s .mutex .Lock ()
75+ defer s .mutex .Unlock ()
7676 currentTime := time .Now ().Unix ()
7777 k := fmt .Sprintf ("%s:%s" , key , subKey )
7878 if v , ok := s .store [k ]; ok {
You can’t perform that action at this time.
0 commit comments