View source: R/error_handling.R
| with_retry | R Documentation |
Implements exponential backoff with jitter for retrying failed API calls
with_retry(
expr,
max_retries = 3,
base_delay = 1,
max_delay = 60,
backoff_factor = 2,
jitter = TRUE,
retry_on = function(e) is_transient_error(e),
on_retry = NULL
)
expr |
Expression to evaluate (usually an API call) |
max_retries |
Maximum number of retry attempts |
base_delay |
Base delay in seconds for first retry |
max_delay |
Maximum delay in seconds |
backoff_factor |
Multiplier for delay between retries |
jitter |
Whether to add random jitter to prevent thundering herd |
retry_on |
Function that takes an error and returns TRUE if should retry |
on_retry |
Function called on each retry attempt with attempt number and error |
Result of successful expression evaluation
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.