Merge branch 'master' of github.com:go-redis/redis

This commit is contained in:
Vladimir Mihailenco 2021-03-01 18:16:57 +02:00
commit aaed549e26
1 changed files with 7 additions and 0 deletions

View File

@ -105,6 +105,13 @@ var _ = Describe("pool", func() {
}) })
It("reuses connections", func() { It("reuses connections", func() {
// explain: https://github.com/go-redis/redis/pull/1675
opt := redisOptions()
opt.MinIdleConns = 0
opt.MaxConnAge = 0
opt.IdleTimeout = 2 * time.Second
client = redis.NewClient(opt)
for i := 0; i < 100; i++ { for i := 0; i < 100; i++ {
val, err := client.Ping(ctx).Result() val, err := client.Ping(ctx).Result()
Expect(err).NotTo(HaveOccurred()) Expect(err).NotTo(HaveOccurred())