mirror of
https://github.com/traefik/traefik.git
synced 2026-05-05 20:36:20 +02:00
fix: reduce pressure of pilot services when errors occurs
This commit is contained in:
parent
73cea2d303
commit
ea8642e2a1
@ -33,6 +33,8 @@ const (
|
||||
pilotInstanceInfoTimer = 5 * time.Minute
|
||||
pilotDynConfTimer = 12 * time.Hour
|
||||
maxElapsedTime = 4 * time.Minute
|
||||
initialInterval = 5 * time.Second
|
||||
multiplier = 3
|
||||
)
|
||||
|
||||
type instanceInfo struct {
|
||||
@ -219,6 +221,8 @@ func (c *client) SendInstanceInfo(ctx context.Context, pilotMetrics []metrics.Pi
|
||||
func (c *client) sendDataRetryable(ctx context.Context, req *http.Request) error {
|
||||
exponentialBackOff := backoff.NewExponentialBackOff()
|
||||
exponentialBackOff.MaxElapsedTime = maxElapsedTime
|
||||
exponentialBackOff.InitialInterval = initialInterval
|
||||
exponentialBackOff.Multiplier = multiplier
|
||||
|
||||
req.Header.Set("Content-Type", "application/json")
|
||||
req.Header.Set(tokenHashHeader, c.tokenHash)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user