Method ScheduleRetryAsync
- Namespace
- MailFathom.Application.Jobs
- Assembly
- MailFathom.Application.dll
ScheduleRetryAsync(JobId, JobLeaseOwner, JobFailureRecord, DateTimeOffset, CancellationToken)
Gives a held job back after a transient failure, claimable again once the instant named has passed.
Task<bool> ScheduleRetryAsync(JobId jobId, JobLeaseOwner owner, JobFailureRecord failure, DateTimeOffset availableAt, CancellationToken cancellationToken)
Parameters
jobIdJobIdThe job to schedule another attempt for.
ownerJobLeaseOwnerThe attempt claiming to hold it.
failureJobFailureRecordWhat this attempt failed with, which replaces whatever the previous one recorded.
availableAtDateTimeOffsetThe instant before which no claim may take the job again.
cancellationTokenCancellationTokenCancels the write.
Returns
Remarks
The attempt stays counted, because it was handed out and spent: the count is what the attempt bound is read against, and a retry that gave it back would loop forever. Delaying the job rather than releasing it is what separates this from a shutdown — a job returned to the queue at once after failing would be taken again as fast as the queue can hand it out.
Exceptions
- ArgumentNullException
Thrown when
ownerorfailureis null.