Commit 4fc49b58 authored by astaxie's avatar astaxie

Merge pull request #58 from yecrane/master

修改redis重启后不会自动连接
parents 22510bc2 67695fac
......@@ -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
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment