mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 14:20:54 +00:00
avoid some proxy not support select command
This commit is contained in:
parent
d96289a81b
commit
ef36ecd376
@ -160,11 +160,14 @@ func (rp *Provider) SessionInit(maxlifetime int64, savePath string) error {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//some redis proxy such as twemproxy is not support select command
|
||||||
|
if rp.dbNum > 0 {
|
||||||
_, err = c.Do("SELECT", rp.dbNum)
|
_, err = c.Do("SELECT", rp.dbNum)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.Close()
|
c.Close()
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return c, err
|
return c, err
|
||||||
}, rp.poolsize)
|
}, rp.poolsize)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user