mirror of
https://github.com/redis/go-redis.git
synced 2025-07-28 06:42:00 +03:00
Gracefully handle situation when Redis Server is down
This commit is contained in:
@ -8,7 +8,13 @@ import (
|
||||
)
|
||||
|
||||
func benchmarkPoolGetPut(b *testing.B, poolSize int) {
|
||||
connPool := pool.NewConnPool(dummyDialer, poolSize, time.Second, time.Hour, time.Hour)
|
||||
connPool := pool.NewConnPool(&pool.Options{
|
||||
Dialer: dummyDialer,
|
||||
PoolSize: poolSize,
|
||||
PoolTimeout: time.Second,
|
||||
IdleTimeout: time.Hour,
|
||||
IdleCheckFrequency: time.Hour,
|
||||
})
|
||||
|
||||
b.ResetTimer()
|
||||
|
||||
@ -38,7 +44,13 @@ func BenchmarkPoolGetPut1000Conns(b *testing.B) {
|
||||
}
|
||||
|
||||
func benchmarkPoolGetRemove(b *testing.B, poolSize int) {
|
||||
connPool := pool.NewConnPool(dummyDialer, poolSize, time.Second, time.Hour, time.Hour)
|
||||
connPool := pool.NewConnPool(&pool.Options{
|
||||
Dialer: dummyDialer,
|
||||
PoolSize: poolSize,
|
||||
PoolTimeout: time.Second,
|
||||
IdleTimeout: time.Hour,
|
||||
IdleCheckFrequency: time.Hour,
|
||||
})
|
||||
|
||||
b.ResetTimer()
|
||||
|
||||
|
Reference in New Issue
Block a user