summaryrefslogtreecommitdiffstats
path: root/src/state/host.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/state/host.rs')
-rw-r--r--src/state/host.rs11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/state/host.rs b/src/state/host.rs
index 863cc70..9b149b8 100644
--- a/src/state/host.rs
+++ b/src/state/host.rs
@@ -13,6 +13,7 @@ use tracing::debug;
use super::{AppState, HelloState, Liveness, NodeLifecycle, PeerState, StaleView, Standing};
use crate::document::replica::Epoch;
+use crate::locks::MutexExt;
use crate::remake::{Host, PeerSummary, RemakeState};
use crate::swarm::sync::{ChangeSet, SyncEvent};
@@ -195,14 +196,8 @@ impl Host for AppState {
fn reset_initial_sync(&self) {
self.initial_sync_done
.store(false, std::sync::atomic::Ordering::Release);
- *self
- .catch_up_source
- .lock()
- .unwrap_or_else(|poisoned| poisoned.into_inner()) = None;
- *self
- .catch_up_preference
- .lock()
- .unwrap_or_else(|poisoned| poisoned.into_inner()) = None;
+ *self.catch_up_source.lock_or_recover() = None;
+ *self.catch_up_preference.lock_or_recover() = None;
}
fn subscribe_changes(&self) -> broadcast::Receiver<Arc<ChangeSet>> {