Method CountStaleDerivedDataAsync
- Namespace
- MailFathom.Application.Emails.Extraction
- Assembly
- MailFathom.Application.dll
CountStaleDerivedDataAsync(CancellationToken)
Counts what was derived under something other than its own user's posture, message text and attachment readings apart.
Task<StaleDerivedDataCount> CountStaleDerivedDataAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenPropagates caller cancellation.
Returns
- Task<StaleDerivedDataCount>
How many stored emails a rebuild would re-derive, and how many readings of an attachment it would discard and have taken again.
Remarks
Answered by the walk's own store rather than by a reader of its own, so the number an operator is shown and the work a rebuild would actually perform come from one predicate. A count taken separately would drift the first time either learned something about tombstones or about missing content.
It counts whether or not the rebuild is switched on, because that is the question it exists to answer: an operator who has just enabled a scanner, or whose user has, needs to know how much of the mail already stored the switch does not reach before deciding whether to spend the re-derivation.
The postures are read by the store rather than supplied, because each row is judged against its own user's and no single value describes the answer. A count summed by a caller over one user at a time would be the same number reached through several round trips.
A message counted for its body and a message counted for its attachments are two different populations, and neither contains the other: a posture republished between the body's derivation and the attachment stage leaves one of the two current. So the answer is two figures rather than a total, and a message whose body and attachments are both stale is one message beside however many readings it carries.