Execute a function with automatic retries on transient failures.
The async function to execute
Retry configuration
The result of the operation
The last error if all retries are exhausted
const result = await withRetry( async () => await client.query("SELECT 1"), { maxRetries: 3, initialDelayMs: 100 }) Copy
const result = await withRetry( async () => await client.query("SELECT 1"), { maxRetries: 3, initialDelayMs: 100 })
Execute a function with automatic retries on transient failures.