drop duplicate warn event

This also gets reported by the "Mark transaction as failed" event.
This commit is contained in:
Charles Hall 2024-06-04 17:34:33 -07:00
parent 72860d98db
commit 419af07b97
No known key found for this signature in database
GPG key ID: 7B8E0645816E07CF

View file

@ -252,17 +252,14 @@ where
tracing::Span::current().record("url", field::display(url)); tracing::Span::current().record("url", field::display(url));
debug!("Sending request"); debug!("Sending request");
let response = let mut response =
services().globals.federation_client().execute(reqwest_request).await; services().globals.federation_client().execute(reqwest_request).await?;
match response {
Ok(mut response) => {
// reqwest::Response -> http::Response conversion // reqwest::Response -> http::Response conversion
let status = response.status(); let status = response.status();
debug!(status = u16::from(status), "Received response"); debug!(status = u16::from(status), "Received response");
let mut http_response_builder = http::Response::builder() let mut http_response_builder =
.status(status) http::Response::builder().status(status).version(response.version());
.version(response.version());
mem::swap( mem::swap(
response.headers_mut(), response.headers_mut(),
http_response_builder http_response_builder
@ -302,12 +299,7 @@ where
FoundKind::FederationDestination, FoundKind::FederationDestination,
FoundIn::Remote, FoundIn::Remote,
); );
services() services().globals.actual_destination_cache.write().await.insert(
.globals
.actual_destination_cache
.write()
.await
.insert(
OwnedServerName::from(destination), OwnedServerName::from(destination),
(actual_destination, host), (actual_destination, host),
); );
@ -315,9 +307,7 @@ where
response.map_err(|e| { response.map_err(|e| {
warn!(error = %e, "Invalid 200 response",); warn!(error = %e, "Invalid 200 response",);
Error::BadServerResponse( Error::BadServerResponse("Server returned bad 200 response.")
"Server returned bad 200 response.",
)
}) })
} else { } else {
Err(Error::Federation( Err(Error::Federation(
@ -326,15 +316,6 @@ where
)) ))
} }
} }
Err(e) => {
warn!(
error = %e,
"Could not send request",
);
Err(e.into())
}
}
}
fn get_ip_with_port(destination_str: &str) -> Option<FedDest> { fn get_ip_with_port(destination_str: &str) -> Option<FedDest> {
if let Ok(destination) = destination_str.parse::<SocketAddr>() { if let Ok(destination) = destination_str.parse::<SocketAddr>() {