Documentation / @andrew_l/mongo-transaction / WithTransactionOptions
Interface: WithTransactionOptions ​
Extends ​
Partial<RetryOnErrorConfig>
Properties ​
beforeRetryCallback? ​
optionalbeforeRetryCallback?: (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? ​
optionaldelayFactor?:number
Delay multiply factor
Inherited from ​
Partial.delayFactor
delayMaxMs? ​
optionaldelayMaxMs?:number
Delay max milliseconds
Inherited from ​
Partial.delayMaxMs
delayMinMs? ​
optionaldelayMinMs?:number
Delay min milliseconds
Inherited from ​
Partial.delayMinMs
maxAttempts? ​
optionalmaxAttempts?:number
Number of attempts to execute a function
Inherited from ​
Partial.maxAttempts
maxRetriesNumber? ​
optionalmaxRetriesNumber?:number
Number of retries until the execution fails (initial + retries)
Deprecated ​
use maxAttempts
Inherited from ​
Partial.maxRetriesNumber
shouldRetryBasedOnError? ​
optionalshouldRetryBasedOnError?: (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