mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-04 17:04:18 +01:00
Merge 'make_from_btree should wait for IO to complete' from Pedro Muniz
Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com> Closes #2144
This commit is contained in:
@@ -157,19 +157,21 @@ impl Schema {
|
||||
let mut automatic_indices: HashMap<String, Vec<(String, usize)>> =
|
||||
HashMap::with_capacity(10);
|
||||
|
||||
match pager.begin_read_tx()? {
|
||||
IOResult::Done(v) => {
|
||||
if matches!(v, LimboResult::Busy) {
|
||||
return Err(LimboError::Busy);
|
||||
loop {
|
||||
match pager.begin_read_tx()? {
|
||||
IOResult::Done(v) => {
|
||||
if matches!(v, LimboResult::Busy) {
|
||||
return Err(LimboError::Busy);
|
||||
}
|
||||
break;
|
||||
}
|
||||
IOResult::IO => pager.io.run_once()?,
|
||||
}
|
||||
IOResult::IO => pager.io.run_once()?,
|
||||
}
|
||||
|
||||
match cursor.rewind()? {
|
||||
IOResult::Done(v) => v,
|
||||
IOResult::IO => pager.io.run_once()?,
|
||||
};
|
||||
while let IOResult::IO = cursor.rewind()? {
|
||||
pager.io.run_once()?
|
||||
}
|
||||
|
||||
loop {
|
||||
let Some(row) = (loop {
|
||||
@@ -285,9 +287,9 @@ impl Schema {
|
||||
drop(record_cursor);
|
||||
drop(row);
|
||||
|
||||
if matches!(cursor.next()?, IOResult::IO) {
|
||||
while let IOResult::IO = cursor.next()? {
|
||||
pager.io.run_once()?;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
pager.end_read_tx()?;
|
||||
|
||||
Reference in New Issue
Block a user