mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-10-01 01:36:12 -04:00
move to const
This commit is contained in:
parent
e34e6a837a
commit
e91c5dcd5b
@ -31,6 +31,8 @@ mod post;
|
|||||||
pub mod routes;
|
pub mod routes;
|
||||||
pub mod site;
|
pub mod site;
|
||||||
|
|
||||||
|
const INCOMING_ACTIVITY_TIMEOUT: Duration = Duration::from_secs(9);
|
||||||
|
|
||||||
pub async fn shared_inbox(
|
pub async fn shared_inbox(
|
||||||
request: HttpRequest,
|
request: HttpRequest,
|
||||||
body: Bytes,
|
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.
|
// 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
|
// 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.
|
// consider the activity broken and move on.
|
||||||
timeout(Duration::from_secs(9), receive_fut)
|
timeout(INCOMING_ACTIVITY_TIMEOUT, receive_fut)
|
||||||
.await
|
.await
|
||||||
.map_err(|_| LemmyErrorType::InboxTimeout)?
|
.map_err(|_| LemmyErrorType::InboxTimeout)?
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user