Skip to content

Commit

Permalink
Configure heroku.RoundTripWithRetryBackoff (#72)
Browse files Browse the repository at this point in the history
Setup heroku.RoundTripWithRetryBackoff to allow the heroku client to
retry with exponential backoff up to 15 seconds, max 5 second interval.
  • Loading branch information
CGA1123 authored Nov 27, 2021
1 parent d1801e5 commit 122cb1c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cmd/slugcmplr/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,15 @@ func netrcClient(cmd outputter) (*heroku.Service, error) {
return heroku.NewService(&http.Client{
Transport: &heroku.Transport{
Username: machine.Login,
Password: machine.Password}}), nil
Password: machine.Password,
Transport: heroku.RoundTripWithRetryBackoff{
MaxElapsedTimeSeconds: 15,
InitialIntervalSeconds: 1,
RandomizationFactor: 0.25,
Multiplier: 2.0,
MaxIntervalSeconds: 5,
},
}}), nil
}

func netrcPath() (string, error) {
Expand Down

0 comments on commit 122cb1c

Please sign in to comment.