(retry int)
| 29 | const baseTimeout time.Duration = 4 * time.Second |
| 30 | |
| 31 | func newTimeout(retry int) time.Duration { |
| 32 | timeout := baseTimeout |
| 33 | for range retry { |
| 34 | timeout *= 2 |
| 35 | } |
| 36 | return timeout |
| 37 | } |
| 38 | |
| 39 | // limiter is initialized as part of worker Init. |
| 40 | var limiter rateLimiter |
no outgoing calls