1
0
mirror of https://github.com/redis/go-redis.git synced 2025-08-08 23:42:06 +03:00

Fix MinIdleConns and MaxConnAge

This commit is contained in:
Vladimir Mihailenco
2019-03-25 13:02:31 +02:00
parent 9ecae37814
commit b706478fdc
5 changed files with 27 additions and 21 deletions

View File

@@ -280,7 +280,7 @@ var _ = Describe("conns reaper", func() {
case "idle":
cn.SetUsedAt(time.Now().Add(-2 * idleTimeout))
case "aged":
cn.InitedAt = time.Now().Add(-2 * maxAge)
cn.SetCreatedAt(time.Now().Add(-2 * maxAge))
}
conns = append(conns, cn)
staleConns = append(staleConns, cn)
@@ -294,9 +294,6 @@ var _ = Describe("conns reaper", func() {
}
for _, cn := range conns {
if cn.InitedAt.IsZero() {
cn.InitedAt = time.Now()
}
connPool.Put(cn)
}