flip min_duration and max_duration

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2024-04-22 20:24:29 -04:00 committed by June
parent 1595037427
commit 5e8ae971f1

View file

@ -409,8 +409,8 @@ impl Service {
.and_modify(|e| match e { .and_modify(|e| match e {
TransactionStatus::Failed(tries, time) => { TransactionStatus::Failed(tries, time) => {
// Fail if a request has failed recently (exponential backoff) // Fail if a request has failed recently (exponential backoff)
let min_duration = Duration::from_secs(services().globals.config.sender_retry_backoff_limit); let min_duration = Duration::from_secs(services().globals.config.sender_timeout);
let max_duration = Duration::from_secs(services().globals.config.sender_timeout); let max_duration = Duration::from_secs(services().globals.config.sender_retry_backoff_limit);
let min_elapsed_duration = min_duration * (*tries) * (*tries); let min_elapsed_duration = min_duration * (*tries) * (*tries);
let min_elapsed_duration = cmp::min(min_elapsed_duration, max_duration); let min_elapsed_duration = cmp::min(min_elapsed_duration, max_duration);
if time.elapsed() < min_elapsed_duration { if time.elapsed() < min_elapsed_duration {