feature(Redis): add db to config (#616)

Co-authored-by: xialeistudio <xialei@100tal.com>
pull/651/head
lei xia 4 years ago committed by GitHub
parent ee96e00411
commit 9d43e492a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      pkg/cache/redis/pool.go
  2. 1
      pkg/cache/redis/redis.go

@ -58,6 +58,7 @@ func NewPool(c *Config, options ...DialOption) (p *Pool) {
DialReadTimeout(time.Duration(c.ReadTimeout)), DialReadTimeout(time.Duration(c.ReadTimeout)),
DialWriteTimeout(time.Duration(c.WriteTimeout)), DialWriteTimeout(time.Duration(c.WriteTimeout)),
DialPassword(c.Auth), DialPassword(c.Auth),
DialDatabase(c.Db),
} }
ops = append(ops, options...) ops = append(ops, options...)
p1 := pool.NewSlice(c.Config) p1 := pool.NewSlice(c.Config)

@ -34,6 +34,7 @@ type Config struct {
Proto string Proto string
Addr string Addr string
Auth string Auth string
Db int
DialTimeout xtime.Duration DialTimeout xtime.Duration
ReadTimeout xtime.Duration ReadTimeout xtime.Duration
WriteTimeout xtime.Duration WriteTimeout xtime.Duration

Loading…
Cancel
Save