Method EraseCompletedBeforeAsync
- Namespace
- MailFathom.Application.Mail.Mutations.Audit
- Assembly
- MailFathom.Application.dll
EraseCompletedBeforeAsync(MailAccountId, DateTimeOffset, int, CancellationToken)
Erases up to a bounded number of one account's entries that ended before a given instant.
Task<int> EraseCompletedBeforeAsync(MailAccountId accountId, DateTimeOffset completedBefore, int limit, CancellationToken cancellationToken)
Parameters
accountIdMailAccountIdThe account whose trail is aged.
completedBeforeDateTimeOffsetThe instant entries must have ended before to be erased.
limitintThe greatest number of entries one call may erase.
cancellationTokenCancellationTokenCancels the erasure.
Returns
Remarks
It joins no session, because it is a set-based delete rather than a change to state a caller is composing. It is idempotent: running it twice over the same window erases nothing the second time.
The bound is what keeps an operator shortening a long retention from turning one pass into a delete that locks the table against every append behind it. What is left over is erased by the next pass, oldest first.
Exceptions
- ArgumentOutOfRangeException
Thrown when
limitis not positive.