diff options
| author | tv <tv@krebsco.de> | 2026-10-31 18:07:07 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-10-31 18:07:07 +0100 |
| commit | 4a9f4507f3161791f80c8c25a6f0e9ccd3649c2c (patch) | |
| tree | 7de1e540b12879364105e275feb07a5b129251a5 /src/api | |
| parent | 4ea5867047d869ea6a33efd6a47a2adc2340114e (diff) | |
move all automerge references to document
Diffstat (limited to 'src/api')
| -rw-r--r-- | src/api/document.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/api/document.rs b/src/api/document.rs index 20bbc7b..08fd21f 100644 --- a/src/api/document.rs +++ b/src/api/document.rs @@ -50,12 +50,11 @@ pub(crate) async fn get_document(State(state): State<AppState>) -> Response { // Both steps take time proportional to the document: off the async threads, and // the lock only for the copy. let saved = tokio::task::spawn_blocking(move || { - let (mut copy, epoch) = { + let (mut copy, epoch, heads) = { let replica = doc.blocking_read(); - (replica.doc.clone(), replica.epoch) + (replica.doc.clone(), replica.epoch, replica.heads().to_vec()) }; - let heads = copy.get_heads(); - (copy.save(), heads, epoch) + (crate::document::save(&mut copy), heads, epoch) }) .await; let (bytes, heads, epoch) = match saved { |
