diff options
Diffstat (limited to 'src/swarm/stats.rs')
| -rw-r--r-- | src/swarm/stats.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/swarm/stats.rs b/src/swarm/stats.rs index eb34276..f9a5b7b 100644 --- a/src/swarm/stats.rs +++ b/src/swarm/stats.rs @@ -9,6 +9,7 @@ use tokio::time::Instant; use tracing::{debug, warn}; use crate::document::replica::Epoch; +use crate::locks::MutexExt; use crate::state::AppState; /// Saving takes time proportional to the document; we spend at most about 1% of it on @@ -120,9 +121,7 @@ impl Default for NodeStats { impl NodeStats { fn lock(&self) -> MutexGuard<'_, Inner> { - self.inner - .lock() - .unwrap_or_else(|poisoned| poisoned.into_inner()) + self.inner.lock_or_recover() } pub(crate) fn caught_up(&self, sync_bytes: u64) { |
