Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions graph/src/runtime/ops/commit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,25 @@ impl<'a> Iterator for CommitOp<'a> {
{
return Some(Err(e));
}
// Commit succeeded — build effects buffer from pending data, then clear.
{
let pending = self.runtime.pending.borrow();
if pending.effects_count() > 0 {
let mut buf_ref = self.runtime.effects_buffer.borrow_mut();
let buf = buf_ref.get_or_insert_with(Vec::new);
let n_effects = pending.build_effects_buffer(&self.runtime.g, buf);
self.runtime
.effects_count
.set(self.runtime.effects_count.get() + n_effects);
}
}
self.runtime.pending.borrow_mut().clear();
// Update schema baseline so the next commit in this query only
// emits newly added schema entries.
self.runtime
.pending
.borrow_mut()
.set_schema_baseline(&self.runtime.g);
// Reverse once so we can pop from the end in O(1) while preserving order.
self.results.reverse();
}
Expand Down
Loading
Loading