mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-31 23:14:21 +01:00
refactor to require Arc<Completion> in file traits so that we can delay IO calls correctly
This commit is contained in:
@@ -672,7 +672,7 @@ impl turso_core::DatabaseStorage for DatabaseFile {
|
||||
return Err(turso_core::LimboError::NotADB);
|
||||
}
|
||||
let pos = (page_idx - 1) * size;
|
||||
self.file.pread(pos, c)?;
|
||||
self.file.pread(pos, c.into())?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -684,12 +684,12 @@ impl turso_core::DatabaseStorage for DatabaseFile {
|
||||
) -> turso_core::Result<()> {
|
||||
let size = buffer.borrow().len();
|
||||
let pos = (page_idx - 1) * size;
|
||||
self.file.pwrite(pos, buffer, c)?;
|
||||
self.file.pwrite(pos, buffer, c.into())?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn sync(&self, c: turso_core::Completion) -> turso_core::Result<()> {
|
||||
let _ = self.file.sync(c)?;
|
||||
let _ = self.file.sync(c.into())?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user