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 | c59f213282517e3ab6fb631a7d8e3f9b91a1c5eb (patch) | |
| tree | 09924d630140527f18ef7ba5b7f60fc28fc8a89b /src/state.rs | |
| parent | 19bc0fbf4e148430064bd040bfe0db25ab137555 (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(_) => { |
