1
0
mirror of https://github.com/astaxie/beego.git synced 2025-06-22 15:50:18 +00:00

Add error to SessionExist interface

Implement changed interface for all default providers as well and change
tests accordingly
This commit is contained in:
Phillip Stagnet
2020-08-03 13:31:49 +02:00
parent 9e1346ef4d
commit 28e6b3b924
14 changed files with 109 additions and 48 deletions

View File

@ -132,9 +132,9 @@ func (lp *Provider) SessionRead(sid string) (session.Store, error) {
}
// SessionExist check ledis session exist by sid
func (lp *Provider) SessionExist(sid string) bool {
func (lp *Provider) SessionExist(sid string) (bool, error) {
count, _ := c.Exists([]byte(sid))
return count != 0
return count != 0, nil
}
// SessionRegenerate generate new sid for ledis session