From e91c5dcd5bf05c167f20ec0aca09b6c4eecbe3dc Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Wed, 8 May 2024 10:44:41 +0200 Subject: [PATCH] move to const --- crates/apub/src/http/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/apub/src/http/mod.rs b/crates/apub/src/http/mod.rs index 0942ea98c..6303dd1b0 100644 --- a/crates/apub/src/http/mod.rs +++ b/crates/apub/src/http/mod.rs @@ -31,6 +31,8 @@ mod post; pub mod routes; pub mod site; +const INCOMING_ACTIVITY_TIMEOUT: Duration = Duration::from_secs(9); + pub async fn shared_inbox( request: HttpRequest, body: Bytes, @@ -42,7 +44,7 @@ pub async fn shared_inbox( // avoid taking a long time to process an incoming activity when a required data fetch times out. // In this case our own instance would timeout and be marked as dead by the sender. Better to // consider the activity broken and move on. - timeout(Duration::from_secs(9), receive_fut) + timeout(INCOMING_ACTIVITY_TIMEOUT, receive_fut) .await .map_err(|_| LemmyErrorType::InboxTimeout)? }