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 {
24
24
// SessionStore struct to store the env variables
25
25
type SessionStore struct {
26
26
wg sync.WaitGroup
27
- mutex sync.RWMutex
27
+ mutex sync.Mutex
28
28
store map [string ]* SessionEntry
29
29
// stores expireTime: key to remove data when cache is full
30
30
// map is sorted by key so older most entry can be deleted first
@@ -35,7 +35,7 @@ type SessionStore struct {
35
35
// NewSessionStore create a new session store
36
36
func NewSessionStore () * SessionStore {
37
37
store := & SessionStore {
38
- mutex : sync.RWMutex {},
38
+ mutex : sync.Mutex {},
39
39
store : make (map [string ]* SessionEntry ),
40
40
keyIndex : make (map [int64 ]string ),
41
41
stop : make (chan struct {}),
@@ -71,8 +71,8 @@ func (s *SessionStore) clean() {
71
71
72
72
// Get returns the value of the key in state store
73
73
func (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 ()
76
76
currentTime := time .Now ().Unix ()
77
77
k := fmt .Sprintf ("%s:%s" , key , subKey )
78
78
if v , ok := s .store [k ]; ok {
You can’t perform that action at this time.
0 commit comments