MaxRetryStrategy
open class MaxRetryStrategy: JobRetryStrategy
Will immediately retry the failed job until the maximum number of failure for that job is reached. Defaults to a max of 5 retries
-
The max number of attempts to be made to process a job, including the initial attempt, before the job is purged from the queue.
Declaration
Swift
public var maxAttempts = 5
-
Initializes this strategy for a given job and the max number of attempts
Declaration
Swift
public convenience init(maxAttempts: Int)
Parameters
handling
The type of job this strategy is handling
maxAttempts
The maximum number of times a job should be attempted to be processed, including the initial attempt to process. If, for example, maxAttempts is 5, then a job will be retried a maximum number of 4 times.
-
Retries the job. If the maximum number of attempts has been reached for the job then the job will not be retried and will be purged from the queue.
Declaration
Parameters
job
The job that failed
queue
The queue on which the job failed