1
0
Fork 0
mirror of https://gitlab.com/famedly/conduit.git synced 2024-11-17 13:10:50 +01:00

fix: force abort federation requests after 2 minutes

This commit is contained in:
Timo Kösters 2023-02-22 22:09:15 +01:00
parent 4617ee2b6b
commit 8b648d0d3f
No known key found for this signature in database
GPG key ID: 0B25E636FBA7E4CB

View file

@ -684,7 +684,15 @@ impl Service {
T: Debug, T: Debug,
{ {
let permit = self.maximum_requests.acquire().await; let permit = self.maximum_requests.acquire().await;
let response = server_server::send_request(destination, request).await; let response = tokio::time::timeout(
Duration::from_secs(2 * 60),
server_server::send_request(destination, request),
)
.await
.map_err(|_| {
warn!("Timeout waiting for server response of {destination}");
Error::BadServerResponse("Timeout waiting for server response")
})?;
drop(permit); drop(permit);
response response