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 | 70beae3b936ee445659e471f40e59ffaa1e1a3d7 (patch) | |
| tree | 91e24e4c7cf2c739c2cec0f8a6190362d66a45f0 /src/api | |
| parent | 37815998b9d37a45f440864f6d3149c3ce9e69f1 (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 { |
