Closed aliculPix4D closed 1 year ago
@Pix4D/integration I will put the PR on hold until I get the comments from @marco-m
@aliculPix4D I left some inline comments.
Regarding the approach I mentioned at the standup, it would involve injecting in the HTTP Client a custom Roundtripper (and this RoundTripper would take care of the retry). That to me would be the correct approach, on the other hand it is not as immediate as I thought, so it might be more pragmatic to use the current approach.
If I look at the code in the PR, my first impression is that it should be possible to simplify it, but I cannot put the finger on where.
@marco-m-pix4d I addressed all the comments and give you my opinion on the value of MaxSleepTime
variable.
Note that we need to mention this behavior (retry in case of rate limit) both in the README and CHANGELOG.
Yes, will do that in another PR...
Commit 1: (NO CHANGE IN THE BEHAVIOUR) github: refactor code to allow adding retry logic
Commit 2: github: implement retry mechanism when rate limited
Just a draft for now to collect a bit of feedback...
If desired, I can already activate retry also for status codes >500 in this PR