duration returns how long the next backoff interval should be.
(count uint32)
| 75 | |
| 76 | // duration returns how long the next backoff interval should be. |
| 77 | func (s *ServerStatistics) duration(count uint32) time.Duration { |
| 78 | return time.Second * time.Duration(math.Exp2(float64(count))) |
| 79 | } |
| 80 | |
| 81 | // cancel will interrupt the currently active backoff. |
| 82 | func (s *ServerStatistics) cancel() { |