static bool TryGetDelay(IncomingMessage message, int delayedDeliveriesPerformed, DelayedConfig config, out TimeSpan delay) { delay = TimeSpan.MinValue; if (config.MaxNumberOfRetries == 0) { return false; } if (delayedDeliveriesPerformed >= config.MaxNumberOfRetries) { return false; } if (HasReachedMaxTime(message)) { return false; } delay = TimeSpan.FromTicks(config.TimeIncrease.Ticks*(delayedDeliveriesPerformed + 1)); return true; }
static bool TryGetDelay(IncomingMessage message, int delayedDeliveriesPerformed, DelayedConfig config, out TimeSpan delay) { delay = TimeSpan.MinValue; if (config.MaxNumberOfRetries == 0) { return(false); } if (delayedDeliveriesPerformed >= config.MaxNumberOfRetries) { return(false); } if (HasReachedMaxTime(message)) { return(false); } delay = TimeSpan.FromTicks(config.TimeIncrease.Ticks * (delayedDeliveriesPerformed + 1)); return(true); }