mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
fix: Don't panic if nobody's listening
This commit is contained in:
@@ -214,9 +214,9 @@ fn fail_federation_txn(
|
|||||||
services.transaction_ids.remove_federation_txn(txn_key);
|
services.transaction_ids.remove_federation_txn(txn_key);
|
||||||
|
|
||||||
// Send the error to any waiters
|
// Send the error to any waiters
|
||||||
sender
|
if let Err(e) = sender.send(Some(Err(err))) {
|
||||||
.send(Some(Err(err)))
|
debug_warn!("Failed to send transaction error to receivers: {e}");
|
||||||
.expect("couldn't send error to channel");
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Converts a TransactionError into an appropriate HTTP error response.
|
/// Converts a TransactionError into an appropriate HTTP error response.
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ use std::{
|
|||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
use conduwuit::{Error, Result, SyncRwLock, debug_warn, warn};
|
use conduwuit::{Error, Result, SyncRwLock, debug_warn, warn};
|
||||||
use database::{Handle, Map};
|
use database::{Handle, Map};
|
||||||
|
use futures::SinkExt;
|
||||||
use ruma::{
|
use ruma::{
|
||||||
DeviceId, OwnedServerName, OwnedTransactionId, TransactionId, UserId,
|
DeviceId, OwnedServerName, OwnedTransactionId, TransactionId, UserId,
|
||||||
api::{
|
api::{
|
||||||
@@ -239,9 +240,9 @@ impl Service {
|
|||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
sender
|
if let Err(e) = sender.send(Some(Ok(response))) {
|
||||||
.send(Some(Ok(response)))
|
debug_warn!("Failed to send transaction response to waiting receivers: {e}");
|
||||||
.expect("couldn't send response to channel");
|
}
|
||||||
|
|
||||||
// explicitly close
|
// explicitly close
|
||||||
drop(sender);
|
drop(sender);
|
||||||
|
|||||||
Reference in New Issue
Block a user