Documentation / @andrew_l/mongo-transaction / WithTransactionOptions
Interface: WithTransactionOptions
Extends
Partial
<RetryOnErrorConfig
>
Properties
beforeRetryCallback()?
optional
beforeRetryCallback: (attempt
,lastAttempt
) =>Promise
<void
|unknown
[]>
The function to execute before retry attempt; Allows to update parameters for the main function by returning then in an array
Parameters
• attempt: number
• lastAttempt: boolean
Returns
Promise
<void
| unknown
[]>
Inherited from
Partial.beforeRetryCallback
delayFactor?
optional
delayFactor:number
Delay multiply factor
Inherited from
Partial.delayFactor
delayMaxMs?
optional
delayMaxMs:number
Delay max milliseconds
Inherited from
Partial.delayMaxMs
delayMinMs?
optional
delayMinMs:number
Delay min milliseconds
Inherited from
Partial.delayMinMs
maxRetriesNumber?
optional
maxRetriesNumber:number
Number of retries until the execution fails
Inherited from
Partial.maxRetriesNumber
shouldRetryBasedOnError()?
optional
shouldRetryBasedOnError: (error
,attempt
) =>boolean
Error validation function. If returns true, the main callback's considered ready to be executed again
Parameters
• error: unknown
• attempt: number
Returns
boolean
Inherited from
Partial.shouldRetryBasedOnError