mirror of
https://github.com/astaxie/beego.git
synced 2025-06-20 23:30: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:
@ -189,12 +189,12 @@ func (rp *Provider) SessionRead(sid string) (session.Store, error) {
|
||||
}
|
||||
|
||||
// SessionExist check redis_sentinel session exist by sid
|
||||
func (rp *Provider) SessionExist(sid string) bool {
|
||||
func (rp *Provider) SessionExist(sid string) (bool, error) {
|
||||
c := rp.poollist
|
||||
if existed, err := c.Exists(sid).Result(); err != nil || existed == 0 {
|
||||
return false
|
||||
return false, err
|
||||
}
|
||||
return true
|
||||
return true, nil
|
||||
}
|
||||
|
||||
// SessionRegenerate generate new sid for redis_sentinel session
|
||||
|
Reference in New Issue
Block a user