mirror of
https://github.com/redis/go-redis.git
synced 2025-07-28 06:42:00 +03:00
Make readOnly a private field so that only cluster client can use it
This commit is contained in:
4
redis.go
4
redis.go
@ -68,7 +68,7 @@ func (c *baseClient) initConn(cn *pool.Conn) error {
|
||||
|
||||
if c.opt.Password == "" &&
|
||||
c.opt.DB == 0 &&
|
||||
!c.opt.ReadOnly &&
|
||||
!c.opt.readOnly &&
|
||||
c.opt.OnConnect == nil {
|
||||
return nil
|
||||
}
|
||||
@ -91,7 +91,7 @@ func (c *baseClient) initConn(cn *pool.Conn) error {
|
||||
pipe.Select(c.opt.DB)
|
||||
}
|
||||
|
||||
if c.opt.ReadOnly {
|
||||
if c.opt.readOnly {
|
||||
pipe.ReadOnly()
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user