diff options
| author | tv <tv@krebsco.de> | 2026-10-24 06:35:11 +0200 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-10-24 06:35:11 +0200 |
| commit | 1d2d3189b4a6ed0d37d0bb8eba43a424a349f59b (patch) | |
| tree | fb8079aba27d9eb7090658e9b4010fcf06fb5f20 /src/state.rs | |
| parent | 722203a3a8f90cb65c02e7a35755fc445a98e01e (diff) | |
add propagation stats
Diffstat (limited to 'src/state.rs')
| -rw-r--r-- | src/state.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/state.rs b/src/state.rs index dfabf8f..b8944ab 100644 --- a/src/state.rs +++ b/src/state.rs @@ -803,7 +803,12 @@ impl AppState { match &result { // One API write = one Automerge change. Ok(_) => { - replica.doc.commit(); + // Stamped with our clock (milliseconds), so receivers can tell + // how long the change took to reach them (`swarm::stats`). + replica.doc.commit_with( + automerge::transaction::CommitOptions::default() + .with_time(unix_millis() as i64), + ); } // Discard partial ops (e.g. old value deleted, new one not written). Err(_) => { |
