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:
parent
4617ee2b6b
commit
8b648d0d3f
1 changed files with 9 additions and 1 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue