Class MailSynchronizationRunLedger
- Assembly
- MailFathom.Application.dll
Holds what this process's synchronization runs are doing and how their last ones ended.
public sealed class MailSynchronizationRunLedger
- Inheritance
-
MailSynchronizationRunLedger
- Inherited Members
Remarks
One instance per process, written by the supervisors as they run and read by the administrative surface. It is deliberately not durable, and that is the decision rather than a shortcut: what it carries is the state that governs scheduling right now — which phase a supervisor is in, the delay it is waiting out, and the consecutive failure count that delay grew from — and every one of those is reset by a restart. A count written across one would name a backoff nothing is applying, which is worse than reporting that this process has not run the account yet.
What does survive a restart is the half that should: a folder's checkpoint is a durable row, so how far synchronization has come and when it last moved are read from the database rather than from here. MailSynchronizationStatusReader is where the two halves meet, and it is what makes a folder that is repeating one batch distinguishable from one with nothing left to do even in a process that has only just started.
Nothing here is mail or derived from it. An account identifier, a folder alias, a phase, counts, and instants are the whole of what it holds.
Constructors
- MailSynchronizationRunLedger(TimeProvider)
Initializes a ledger that has observed no run.
Methods
- ReadAccount(MailAccountId)
Reads where one account's synchronization stands.
- ReadFolder(MailFolderIdentity)
Reads how one folder's most recent turn through a run ended.
- RecordFolderSynchronized(MailFolderIdentity, int, int, int, bool)
Records a folder's turn that reached the folder its alias is bound to.
- RecordFolderUnsynchronized(MailFolderIdentity, MailFolderRunOutcome)
Records a folder's turn that did not synchronize the folder, whatever kept it from doing so.
- RecordNextRunDue(MailAccountId, TimeSpan, int)
Records the wait one account is about to take, and the failure count that wait was grown from.
- RecordRunEnded(MailAccountId, int, int, bool)
Records how one account's run ended.
- RecordRunQueued(MailAccountId)
Records that an account is ready to run and is waiting for one of the slots that bound simultaneity.
- RecordRunStarted(MailAccountId)
Records that an account has taken a slot and its run has begun.