fivem-ts

a library to speed up the development of Fivem scripts and frameworks


Project maintained by Purpose-Dev Hosted on GitHub Pages — Theme by mattgraham

fivem-ts - Documentation v0.7.5Docs


fivem-ts - Documentation v0.7.5 / Shared / getRetryMetadata

Function: getRetryMetadata()

getRetryMetadata(target, propertyKey): Maybe<RetryValue>

Retrieves the retry metadata for a given method.

This function can be used to obtain the number of retry attempts and the delay between attempts for a method decorated with the Retry decorator.

Parameters

target: object

The target object (usually the prototype of a class).

propertyKey: string

The name of the method to retrieve metadata for.

Returns

Maybe<RetryValue>

An object containing the number of attempts and the delay, or undefined if not found.

Example

import { getRetryMetadata } from 'fivem-ts/shared/decorators';

const retryMetadata = getRetryMetadata(MyService.prototype, 'unstableMethod');
if (retryMetadata) {
    console.log(`Retry attempts: ${retryMetadata.attempts}, Delay: ${retryMetadata.delay}`);
}

Defined in

shared/decorators/core/Retry.ts:84