From 67695fac9ee21098efc8f2b09f720e8a13220373 Mon Sep 17 00:00:00 2001 From: yecrane Date: Wed, 22 May 2013 22:26:26 +0800 Subject: [PATCH] Update sess_redis.go MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改redis重启后不会自动连接 --- session/sess_redis.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/session/sess_redis.go b/session/sess_redis.go index 06499db6..e13fd5a4 100644 --- a/session/sess_redis.go +++ b/session/sess_redis.go @@ -55,9 +55,9 @@ func (rp *RedisProvider) connectInit() redis.Conn { return nil } return c*/ - if redisPool == nil { + //if redisPool == nil { redisPool = make(chan redis.Conn, MAX_POOL_SIZE) - } + //} if len(redisPool) == 0 { go func() { for i := 0; i < MAX_POOL_SIZE/2; i++ { @@ -76,7 +76,7 @@ func putRedis(conn redis.Conn) { if redisPool == nil { redisPool = make(chan redis.Conn, MAX_POOL_SIZE) } - if len(redisPool) == MAX_POOL_SIZE { + if len(redisPool) >= MAX_POOL_SIZE { conn.Close() return }