MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / sync_all

Method sync_all

crates/commitlog/src/stream/writer.rs:265–270  ·  view source on GitHub ↗

Flush and sync the currently written-to segment (if any) to disk. Dropping a [`StreamWriter`] will attempt to invoke this, but any errors will not be visible. Also, if the async runtime is already shutting down, the task spawned by the [`Drop`] impl may not get a chance to run.

(&mut self)

Source from the content-addressed store, hash-verified

263 /// will not be visible. Also, if the async runtime is already shutting down,
264 /// the task spawned by the [`Drop`] impl may not get a chance to run.
265 pub async fn sync_all(&mut self) -> io::Result<()> {
266 let Some(current_segment) = self.current_segment.as_mut() else {
267 return Ok(());
268 };
269 current_segment.flush_and_sync().await
270 }
271
272 async fn append_all_inner(
273 &mut self,

Callers 6

create_segmentMethod · 0.45
copy_allFunction · 0.45
copy_rangesFunction · 0.45
copy_invalid_rangeFunction · 0.45
trim_garbageFunction · 0.45

Calls 3

OkFunction · 0.50
as_mutMethod · 0.45
flush_and_syncMethod · 0.45

Tested by 5

copy_allFunction · 0.36
copy_rangesFunction · 0.36
copy_invalid_rangeFunction · 0.36
trim_garbageFunction · 0.36