Commit ef36ecd3 authored by zhufanmao's avatar zhufanmao

avoid some proxy not support select command

parent d96289a8
...@@ -160,11 +160,14 @@ func (rp *Provider) SessionInit(maxlifetime int64, savePath string) error { ...@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment