Alokai

RetryContext

interface RetryContext {
	attempt: number;
	extensionName?: string;
	functionName: string;
	integrationName: string;
	logger: LoggerInterface;
	retries: number;
}

Properties

NameRequiredTypeDescription
attemptRequirednumber1-based number of the retry about to be performed (first retry is 1).
extensionNameOptionalstringThe extension name when a namespaced extension method is called; undefined for the integration's own methods and non-namespaced extensions.
functionNameRequiredstringThe unified method being retried, e.g. "getProduct".
integrationNameRequiredstringThe integration key from middleware.config.ts, e.g. "commerce".
loggerRequiredLoggerInterfaceRequest-scoped Alokai logger, for logging retry decisions from a custom retryCondition.
retriesRequirednumberTotal number of retries allowed by the policy - the attempt budget. attempt never exceeds this, so attempt === retries is the last retry.

On this page