nozzlegear / ShopifySharp

ShopifySharp is a .NET library that helps developers easily authenticate with and manage Shopify stores.
https://nozzlegear.com/shopify-development-handbook
MIT License
764 stars 313 forks source link

Feature: Retry policy with exponential delay #1065

Closed nozzlegear closed 6 months ago

nozzlegear commented 6 months ago

This pull adds a retry policy with an exponential delay in between failed requests. It's very similar to the default RetryExecutionPolicy, except that each failure adds a (2 ^ currentTry - 1) * delayInMilliseconds before it tries again.

The policy makes not attempt to be smart, it does not care about Shopify rate limits or other requests made by the same shop. It's just a "dumb" policy that will exponentially delay itself until a request goes through or a maximum number of tries have been attempted.

Just missing the last few tests before merging.