From 22f9b9b91d76dd3145b39d29404c20f38c6d48b9 Mon Sep 17 00:00:00 2001 From: timedout Date: Tue, 11 Aug 2026 17:38:20 +0100 Subject: [PATCH] fix(sender): retry_after duration can be negative --- src/service/federation/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/service/federation/mod.rs b/src/service/federation/mod.rs index acec86919..718db6546 100644 --- a/src/service/federation/mod.rs +++ b/src/service/federation/mod.rs @@ -78,7 +78,7 @@ impl Service { let map = self.remote_health.read(); let unix_now = millis_since_unix_epoch(); map.get(server_name) - .map(|(_, next_retry)| Duration::from_millis((*next_retry).expected_sub(unix_now))) + .map(|(_, next_retry)| Duration::from_millis((*next_retry).saturating_sub(unix_now))) } /// Marks or updates a remote's health status as unhealthy. If the remote is