Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
My second mistake on redis session db because I'm not personally use redis, so I'm waiting for redis users to find these type of errors inside it, such as @sy264115809


Former-commit-id: df84348df7509c0f863f41f01de6ed6db6e8133e
  • Loading branch information
kataras committed Aug 21, 2017
1 parent 40f79c1 commit 3ec5ff5
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions sessions/sessiondb/redis/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,17 @@ func (db *Database) Load(sid string) (storeDB sessions.RemoteStore) {
return
}

storeDB, ok := storeMaybe.(sessions.RemoteStore)
storeB, ok := storeMaybe.([]byte)
if !ok {
golog.Errorf("something wrong, store should be stored as []byte but stored as %#v", storeMaybe)
return
}

storeDB, err = sessions.DecodeRemoteStore(storeB) // decode the whole value, as a remote store
if err != nil {
golog.Errorf(`error while trying to load session values(%s) from redis:
the retrieved value is not a sessions.RemoteStore type, please report that as bug, it should never occur`,
the retrieved value is not a sessions.RemoteStore type, please report that as bug, that should never occur`,
sid)
return
}

return
Expand Down

0 comments on commit 3ec5ff5

Please sign in to comment.