mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-10 18:54:22 +01:00
when run_once fails we abort the current IOCompletions
This commit is contained in:
@@ -2048,6 +2048,9 @@ impl Statement {
|
||||
return res;
|
||||
}
|
||||
if res.is_err() {
|
||||
if let Some(io) = &self.state.io_completions {
|
||||
io.abort();
|
||||
}
|
||||
let state = self.program.connection.transaction_state.get();
|
||||
if let TransactionState::Write { .. } = state {
|
||||
let end_tx_res = self.pager.end_tx(true, &self.program.connection, true)?;
|
||||
|
||||
@@ -2494,6 +2494,14 @@ impl IOCompletions {
|
||||
IOCompletions::Many(completions) => completions.iter().all(|c| c.finished()),
|
||||
}
|
||||
}
|
||||
|
||||
/// Send abort signal to completions
|
||||
pub fn abort(&self) {
|
||||
match self {
|
||||
IOCompletions::Single(c) => c.abort(),
|
||||
IOCompletions::Many(completions) => completions.iter().for_each(|c| c.abort()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
|
||||
Reference in New Issue
Block a user