summaryrefslogtreecommitdiffstats
path: root/src/api/peers.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/peers.rs')
-rw-r--r--src/api/peers.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/api/peers.rs b/src/api/peers.rs
index a9694f7..fac3440 100644
--- a/src/api/peers.rs
+++ b/src/api/peers.rs
@@ -16,6 +16,7 @@ use utoipa::ToSchema;
use super::store_status;
use crate::document::replica::Epoch;
use crate::document::store;
+use crate::locks::MutexExt;
use crate::state::{AppState, HelloState, Incidents, Liveness, PeerState};
use crate::swarm::peer::forgotten_path;
use crate::transport::traffic::PeerTraffic;
@@ -141,8 +142,7 @@ pub(crate) async fn list_peers(
let traffic = state.traffic.peer(&public_key).unwrap_or_default();
let sync_throughput = state
.throughput
- .lock()
- .unwrap_or_else(|poisoned| poisoned.into_inner())
+ .lock_or_recover()
.get(&public_key)
.map(|estimate| ThroughputInfo {
bytes_per_sec: estimate.bytes_per_sec.round(),