From a10bf7d4104ea433156a6c17a72dda8c0ea9673e Mon Sep 17 00:00:00 2001 From: Nutomic Date: Tue, 22 Mar 2022 18:40:40 +0000 Subject: [PATCH] Adjust retry interval for sending activities (#2141) --- crates/apub_lib/src/activity_queue.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/crates/apub_lib/src/activity_queue.rs b/crates/apub_lib/src/activity_queue.rs index ca8645cb..a94229ff 100644 --- a/crates/apub_lib/src/activity_queue.rs +++ b/crates/apub_lib/src/activity_queue.rs @@ -72,8 +72,19 @@ impl ActixJob for SendActivityTask { type Future = Pin>>>; const NAME: &'static str = "SendActivityTask"; + /// With these params, retries are made at the following intervals: + /// 3s + /// 9s + /// 27s + /// 1m 21s + /// 4m 3s + /// 12m 9s + /// 36m 27s + /// 1h 49m 21s + /// 5h 28m 3s + /// 16h 24m 9s const MAX_RETRIES: MaxRetries = MaxRetries::Count(10); - const BACKOFF: Backoff = Backoff::Exponential(2); + const BACKOFF: Backoff = Backoff::Exponential(3); fn run(self, state: Self::State) -> Self::Future { Box::pin(async move { do_send(self, &state.client).await }) -- 2.44.1