mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-27 21:14:21 +01:00
IOCompletions: abort other remaining completions if previous one errors
This commit is contained in:
@@ -2480,8 +2480,15 @@ impl IOCompletions {
|
||||
match self {
|
||||
IOCompletions::Single(c) => io.wait_for_completion(c),
|
||||
IOCompletions::Many(completions) => {
|
||||
for c in completions {
|
||||
io.wait_for_completion(c)?;
|
||||
let mut completions = completions.into_iter();
|
||||
while let Some(c) = completions.next() {
|
||||
let res = io.wait_for_completion(c);
|
||||
if res.is_err() {
|
||||
for c in completions {
|
||||
c.abort();
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user