Table of Contents

Class SynchronizationRunBackoff

Namespace
MailFathom.Application.Synchronization
Assembly
MailFathom.Application.dll

Decides how long one account waits before its next synchronization run.

public static class SynchronizationRunBackoff
Inheritance
SynchronizationRunBackoff
Inherited Members

Remarks

This is run-level backoff, and it is a different decision from the operation-level retry an adapter's resilience pipeline performs. The pipeline decides whether one IMAP command is worth repeating; this decides whether a whole run is worth starting again yet. The two never wrap each other: a run that ended in failure has already spent its pipeline budget, so starting the next one on the ordinary interval would spend the same budget again against a server that has just refused it.

A successful run returns the account to its configured interval, so backoff never outlives the condition that caused it, and the delay is drawn from a range rather than computed exactly. Accounts that share a mail server fail together, and an exact delay would return every one of them to that server in the same instant on every later run.

The curve itself is JitteredRetryBackoff, which every scheduler of this system draws its delays from. What is decided here is what a synchronization run means by it: a failure count rather than an attempt count, the configured interval as the floor, and a healthy account answered before any of that arithmetic runs.

Methods

DelayBeforeNextRun(TimeSpan, TimeSpan, int)

Computes the delay before one account's next synchronization run.