easypost-csharp icon indicating copy to clipboard operation
easypost-csharp copied to clipboard

POC: Backoff retries

Open nwithan8 opened this issue 3 years ago • 0 comments

Description

  • Built-in backoff retry logic to automatically retry HTTP calls when retrieving specific status codes
    • Credit to the Polly library that handles this, and this thread for figuring out how to do it with RestSharp

Testing

  • No unit test currently, since it's hard to simulate a bad status code.
    • If we purposefully include "good" status codes in the list of retry codes (e.g., trick the system into retrying even on a 200), we can see the system works as expected.

Pull Request Type

Please select the option(s) that are relevant to this PR.

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] Improvement (fixing a typo, updating readme, renaming a variable name, etc)

nwithan8 avatar Aug 22 '22 23:08 nwithan8