diff options
| author | tv <tv@krebsco.de> | 2026-10-28 05:42:07 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-10-28 05:42:07 +0100 |
| commit | 3ba7a51b55603cbc3c9bdfb86a1ed37283691825 (patch) | |
| tree | 90cfb6232b8e7570171890f15f33b0d056bed7fc /src/state | |
| parent | 3695ca8d58001f17a46c42f00db24b0e77c8bcac (diff) | |
add document lock stats
Diffstat (limited to 'src/state')
| -rw-r--r-- | src/state/mod.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/state/mod.rs b/src/state/mod.rs index d8291a7..fec164d 100644 --- a/src/state/mod.rs +++ b/src/state/mod.rs @@ -40,7 +40,8 @@ use tokio::sync::{Mutex, RwLock, broadcast, mpsc, watch}; use tokio::time::Instant; use tracing::{debug, error, warn}; -use crate::document::replica::{Epoch, Replica, Stamp}; +use crate::document::lock::DocumentLock; +use crate::document::replica::{Epoch, Stamp}; use crate::locks::MutexExt; use crate::remake::{Host, RemakeState}; use crate::swarm::sync::{ChangeSet, SyncEvent}; @@ -58,7 +59,7 @@ pub(crate) enum NodeLifecycle { #[derive(Clone)] pub(crate) struct AppState { /// The document and its epoch. Derefs to `AutoCommit`. - pub(crate) doc: Arc<RwLock<Replica>>, + pub(crate) doc: Arc<DocumentLock>, /// Copy of `doc.epoch` for cheap, lock-free reads (handshakes, keepalives, /peers). /// Only ever changed while holding `doc`'s write lock, together with `doc.epoch`. |
