67695fac by yecrane

Update sess_redis.go

修改redis重启后不会自动连接
1 parent a2dd859e
...@@ -55,9 +55,9 @@ func (rp *RedisProvider) connectInit() redis.Conn { ...@@ -55,9 +55,9 @@ func (rp *RedisProvider) connectInit() redis.Conn {
55 return nil 55 return nil
56 } 56 }
57 return c*/ 57 return c*/
58 if redisPool == nil { 58 //if redisPool == nil {
59 redisPool = make(chan redis.Conn, MAX_POOL_SIZE) 59 redisPool = make(chan redis.Conn, MAX_POOL_SIZE)
60 } 60 //}
61 if len(redisPool) == 0 { 61 if len(redisPool) == 0 {
62 go func() { 62 go func() {
63 for i := 0; i < MAX_POOL_SIZE/2; i++ { 63 for i := 0; i < MAX_POOL_SIZE/2; i++ {
...@@ -76,7 +76,7 @@ func putRedis(conn redis.Conn) { ...@@ -76,7 +76,7 @@ func putRedis(conn redis.Conn) {
76 if redisPool == nil { 76 if redisPool == nil {
77 redisPool = make(chan redis.Conn, MAX_POOL_SIZE) 77 redisPool = make(chan redis.Conn, MAX_POOL_SIZE)
78 } 78 }
79 if len(redisPool) == MAX_POOL_SIZE { 79 if len(redisPool) >= MAX_POOL_SIZE {
80 conn.Close() 80 conn.Close()
81 return 81 return
82 } 82 }
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!