mirror of https://github.com/matrix-org/go-neb.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
503 B
25 lines
503 B
package twitter
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/cenkalti/backoff"
|
|
)
|
|
|
|
func newExponentialBackOff() *backoff.ExponentialBackOff {
|
|
b := backoff.NewExponentialBackOff()
|
|
b.InitialInterval = 5 * time.Second
|
|
b.Multiplier = 2.0
|
|
b.MaxInterval = 320 * time.Second
|
|
b.Reset()
|
|
return b
|
|
}
|
|
|
|
func newAggressiveExponentialBackOff() *backoff.ExponentialBackOff {
|
|
b := backoff.NewExponentialBackOff()
|
|
b.InitialInterval = 1 * time.Minute
|
|
b.Multiplier = 2.0
|
|
b.MaxInterval = 16 * time.Minute
|
|
b.Reset()
|
|
return b
|
|
}
|