openmrs-esm-core

O3 Framework / retry

Function: retry()

retry<T>(fn, options): Promise<T>

Defined in: packages/framework/esm-utils/src/retry.ts:40

Executes the specified function and retries executing on failure with a custom backoff strategy defined by the options.

If not configured otherwise, this function uses the following default options:

Type Parameters

T

T

Parameters

fn

() => Promise<T>

The function to be executed and retried on failure.

options

RetryOptions = {}

Additional options which configure the retry behavior.

Returns

Promise<T>

The result of successfully executing fn.

Throws

Rethrows the final error of running fn when the function stops retrying.