mirror of
https://github.com/redis/go-redis.git
synced 2025-07-28 06:42:00 +03:00
Set cmd timeout when Block >= 0
This commit is contained in:
6
redis.go
6
redis.go
@ -188,7 +188,11 @@ func (c *baseClient) retryBackoff(attempt int) time.Duration {
|
||||
|
||||
func (c *baseClient) cmdTimeout(cmd Cmder) time.Duration {
|
||||
if timeout := cmd.readTimeout(); timeout != nil {
|
||||
return readTimeout(*timeout)
|
||||
t := *timeout
|
||||
if t == 0 {
|
||||
return 0
|
||||
}
|
||||
return t + 10*time.Second
|
||||
}
|
||||
return c.opt.ReadTimeout
|
||||
}
|
||||
|
Reference in New Issue
Block a user