mirror of
https://github.com/Dasemu/Synapse.git
synced 2026-11-26 15:26:17 +00:00
feat(core): nestable transactions, put_page and journals_before
Importer runs its write phase in one transaction (replaces the synchronous=OFF workaround); the FFI journals feed uses journals_before instead of walking back one day per query. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
537d70bb55
commit
30d58a0166
4 files changed
+117
-26
No files matched your search
@@ -182,12 +182,9 @@ pub fn import_logseq(
|
||||
}
|
||||
}
|
||||
|
||||
// Every core write commits on its own; without fsyncs that is cheap. A crash mid-import
|
||||
// only needs a re-import (idempotent), so durability per commit is not required.
|
||||
let _ = graph.conn().pragma_update(None, "synchronous", "OFF");
|
||||
let result = write_all(graph, opts, &docs, &origin, &mut report, &mut progress);
|
||||
let _ = graph.conn().pragma_update(None, "synchronous", "NORMAL");
|
||||
result?;
|
||||
// One transaction for the whole write phase: much faster, and a failed import leaves the
|
||||
// graph untouched.
|
||||
graph.transaction(|g| write_all(g, opts, &docs, &origin, &mut report, &mut progress))?;
|
||||
Ok(report)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user