@@ -7,17 +7,17 @@ import (
77
88// ClearStore clears the in-memory store.
99func (c * provider ) ClearStore () error {
10- c .mutex .Lock ()
11- defer c .mutex .Unlock ()
10+ // c.mutex.Lock()
11+ // defer c.mutex.Unlock()
1212 c .sessionStore = map [string ]map [string ]string {}
1313
1414 return nil
1515}
1616
1717// GetUserSessions returns all the user session token from the in-memory store.
1818func (c * provider ) GetUserSessions (userId string ) map [string ]string {
19- c .mutex .Lock ()
20- defer c .mutex .Unlock ()
19+ // c.mutex.Lock()
20+ // defer c.mutex.Unlock()
2121 res := map [string ]string {}
2222 for k , v := range c .stateStore {
2323 split := strings .Split (v , "@" )
@@ -31,8 +31,8 @@ func (c *provider) GetUserSessions(userId string) map[string]string {
3131
3232// DeleteAllUserSession deletes all the user sessions from in-memory store.
3333func (c * provider ) DeleteAllUserSession (userId string ) error {
34- c .mutex .Lock ()
35- defer c .mutex .Unlock ()
34+ // c.mutex.Lock()
35+ // defer c.mutex.Unlock()
3636 sessions := c .GetUserSessions (userId )
3737 for k := range sessions {
3838 c .RemoveState (k )
@@ -43,17 +43,17 @@ func (c *provider) DeleteAllUserSession(userId string) error {
4343
4444// SetState sets the state in the in-memory store.
4545func (c * provider ) SetState (key , state string ) error {
46- c .mutex .Lock ()
47- defer c .mutex .Unlock ()
46+ // c.mutex.Lock()
47+ // defer c.mutex.Unlock()
4848 c .stateStore [key ] = state
4949
5050 return nil
5151}
5252
5353// GetState gets the state from the in-memory store.
5454func (c * provider ) GetState (key string ) (string , error ) {
55- c .mutex .Lock ()
56- defer c .mutex .Unlock ()
55+ // c.mutex.Lock()
56+ // defer c.mutex.Unlock()
5757
5858 state := ""
5959 if stateVal , ok := c .stateStore [key ]; ok {
@@ -65,8 +65,8 @@ func (c *provider) GetState(key string) (string, error) {
6565
6666// RemoveState removes the state from the in-memory store.
6767func (c * provider ) RemoveState (key string ) error {
68- c .mutex .Lock ()
69- defer c .mutex .Unlock ()
68+ // c.mutex.Lock()
69+ // defer c.mutex.Unlock()
7070 delete (c .stateStore , key )
7171
7272 return nil
0 commit comments