From 8e07c95b56af4f472ff8592a67df6e5469ffb625 Mon Sep 17 00:00:00 2001 From: crusader Date: Thu, 9 Nov 2017 17:01:55 +0900 Subject: [PATCH] ing --- constants.go | 8 ++++---- pool_handlers.go | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/constants.go b/constants.go index 154913e..54f2fe4 100644 --- a/constants.go +++ b/constants.go @@ -1,12 +1,12 @@ package redis_pool const ( - // Maximum number of idle connections in the pool. - DefaultMaxIdle = 1 - // Maximum number of connections allocated by the pool at a given time. // When zero, there is no limit on the number of connections in the pool. - DefaultMaxActive = 1 + DefaultMaxCapacity = 1 + + // Maximum number of idle connections in the pool. + DefaultMaxIdle = 1 // Close connections after remaining idle for this duration. If the value // is zero, then idle connections are not closed. Applications should set diff --git a/pool_handlers.go b/pool_handlers.go index feac814..3feb532 100644 --- a/pool_handlers.go +++ b/pool_handlers.go @@ -47,12 +47,12 @@ func (ph *PoolHandlers) IsWait() bool { } func (ph *PoolHandlers) Validate() { + if ph.MaxCapacity <= 0 { + ph.MaxCapacity = DefaultMaxCapacity + } if ph.MaxIdle <= 0 { ph.MaxIdle = DefaultMaxIdle } - if ph.MaxActive <= 0 { - ph.MaxActive = DefaultMaxActive - } if ph.IdleTimeout <= 0 { ph.IdleTimeout = DefaultIdleTimeout }