ing
This commit is contained in:
parent
497fde3617
commit
8e07c95b56
|
@ -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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user