Method ReleaseAsync
- Namespace
- MailFathom.Application.Jobs
- Assembly
- MailFathom.Application.dll
ReleaseAsync(JobId, JobLeaseOwner, CancellationToken)
Gives a held job back unfinished, so it is claimable again at once.
Task<bool> ReleaseAsync(JobId jobId, JobLeaseOwner owner, CancellationToken cancellationToken)
Parameters
jobIdJobIdThe job to release.
ownerJobLeaseOwnerThe attempt claiming to hold it.
cancellationTokenCancellationTokenCancels the write.
Returns
Remarks
It is what a shutdown does with work it was holding, and it is deliberately not a failure. The attempt the claim counted is given back with the job, because a deployment is not something the work did: a long job interrupted by a rolling restart would otherwise reach the attempt bound and be dead-lettered without ever having failed.
Exceptions
- ArgumentNullException
Thrown when
owneris null.