reduce duplicate events

I hate `log_error`. A better way to do this would be to not reuse the
same error type literally everywhere, so you could distinguish, in
`crate::service::sending::Service::handle_response`, whether to emit an
event based on which function created the error. Fixing that is a lot
more work, though.
This commit is contained in:
Charles Hall 2024-06-23 17:41:53 -07:00
parent 82cc605b5f
commit e83a30af4b
No known key found for this signature in database
GPG key ID: 7B8E0645816E07CF
2 changed files with 12 additions and 8 deletions

View file

@ -286,8 +286,8 @@ impl Service {
}))
}
}
Err(_err) => {
warn!("Marking transaction as failed");
Err(error) => {
warn!(%error, "Marking transaction as failed");
current_transaction_status.entry(destination).and_modify(|e| {
*e = match e {
TransactionStatus::Running => {
@ -684,7 +684,7 @@ impl Service {
debug!("Got permit");
let response = tokio::time::timeout(
Duration::from_secs(2 * 60),
server_server::send_request(destination, request),
server_server::send_request(destination, request, true),
)
.await
.map_err(|_| {
@ -920,6 +920,7 @@ async fn handle_federation_event(
))
.into(),
},
false,
)
.await?;