a library to speed up the development of Fivem scripts and frameworks
fivem-ts - Documentation v0.7.5 • Docs
fivem-ts - Documentation v0.7.5 / Shared / 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.
• target: object
The target object (usually the prototype of a class).
• propertyKey: string
The name of the method to retrieve metadata for.
An object containing the number of attempts and the delay, or undefined
if not found.
import { getRetryMetadata } from 'fivem-ts/shared/decorators';
const retryMetadata = getRetryMetadata(MyService.prototype, 'unstableMethod');
if (retryMetadata) {
console.log(`Retry attempts: ${retryMetadata.attempts}, Delay: ${retryMetadata.delay}`);
}