(with-retry f max-retries)
Creates a retry wrapper for the given function.
Parameters:
Returns: A new function that will retry the original function up to max-retries times if it encounters a retryable status code (429 or >= 500).
The returned function will:
Creates a retry wrapper for the given function. Parameters: - f: The function to be retried. It should return a map containing a :status key. - max-retries: The maximum number of retry attempts. Returns: A new function that will retry the original function up to max-retries times if it encounters a retryable status code (429 or >= 500). The returned function will: 1. Execute the original function. 2. If the result has a retryable status, it will wait using exponential backoff with jitter. 3. Retry up to max-retries times. 4. Return the body of the last attempt, whether successful or not.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close