Skip to content

Commit

Permalink
Update backoff to only apply when the header isn't set
Browse files Browse the repository at this point in the history
  • Loading branch information
RicePatrick committed Aug 24, 2024
1 parent 07b7c25 commit 65c324f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions gitlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -525,12 +525,13 @@ func rateLimitBackoff(min, max time.Duration, attemptNum int, resp *http.Respons
min = wait
}
}
} else {
// For each attempt without the header, back off an additiona 100% exponentially. With the default milliseconds
// being set to 100 for `min`, this makes the 5th retry wait 3.2 seconds (3,200 ms) by default
min = time.Duration(float64(min) * math.Pow(2, float64(attemptNum)))
}
}

// For each attempt, back off an additiona 100% exponentially. With the default milliseconds
// being set to 100 for `min`, this makes the 5th retry wait 3.2 seconds (3,200 ms) by default
min = time.Duration(float64(min) * math.Pow(2, float64(attemptNum)))
return min + jitter
}

Expand Down

0 comments on commit 65c324f

Please sign in to comment.