Table of Contents

Method DelayBeforeNextAttempt

Namespace
MailFathom.Application.Jobs.Execution
Assembly
MailFathom.Application.dll

DelayBeforeNextAttempt(TimeSpan, TimeSpan, int)

Computes how long a job waits before its next attempt.

public static TimeSpan DelayBeforeNextAttempt(TimeSpan baseDelay, TimeSpan maxDelay, int attemptCount)

Parameters

baseDelay TimeSpan

The delay the first retry is drawn around, from which the doubling grows.

maxDelay TimeSpan

The ceiling a grown delay never exceeds.

attemptCount int

How many attempts the job has already been handed out for, counting from one.

Returns

TimeSpan

A jittered delay of at least half the grown ceiling and at most maxDelay.

Exceptions

ArgumentOutOfRangeException

Thrown when baseDelay is not positive, when maxDelay is below it, or when attemptCount is not positive.