Method EraseEvaluatedBeforeAsync
- Namespace
- MailFathom.Application.Rules.History
- Assembly
- MailFathom.Application.dll
EraseEvaluatedBeforeAsync(MailAccountId, DateTimeOffset, int, CancellationToken)
Erases up to a bounded number of one account's executions recorded before a given instant.
Task<int> EraseEvaluatedBeforeAsync(MailAccountId accountId, DateTimeOffset evaluatedBefore, int limit, CancellationToken cancellationToken)
Parameters
accountIdMailAccountIdThe account whose history is aged.
evaluatedBeforeDateTimeOffsetThe instant an execution must have been recorded before to be erased.
limitintThe greatest number of executions 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 actions an erased execution recorded go with it, because they hang on the execution.
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.