replicate-swift icon indicating copy to clipboard operation
replicate-swift copied to clipboard

Add automatic retry policy

Open mattt opened this issue 2 years ago • 1 comments

This PR refactors the client's internal fetch method to automatically retry requests as appropriate (429 status code, as well as 5xx errors for GET requests). If the server sends a Retry-After header, that value is used. Otherwise, the function delays for a configured interval with exponential backoff and jitter.

This should all be in line with the retry logic in the Python client.

mattt avatar Aug 04 '23 18:08 mattt

Blocked by test cases not supporting different responses.

mattt avatar Aug 10 '23 16:08 mattt