Method RederiveStoredContentBytesAsync
- Namespace
- MailFathom.Application.EmailContent.Storage
- Assembly
- MailFathom.Application.dll
RederiveStoredContentBytesAsync(MailAccountId, CancellationToken)
Recomputes one account's figure from its stored payloads and adopts it.
Task<long> RederiveStoredContentBytesAsync(MailAccountId account, CancellationToken cancellationToken)
Parameters
accountMailAccountIdThe account whose counter is re-derived.
cancellationTokenCancellationTokenCancels the recomputation.
Returns
Remarks
This is the expensive answer the maintained one exists to avoid, so it is a repair rather than something a run reaches for. Unlike every movement of the figure, it replaces a total rather than adding to one, so it cannot be left to race: it claims the account's row before it recomputes and holds it until the recomputation is written, so a store committing meanwhile is either counted by the recomputation or applied on top of it, never discarded by it. That makes it the one operation here which needs a transaction of its own.
Exceptions
- ArgumentException
Thrown when
accountnames nothing.