mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-19 06:55:18 +01:00
Make sure to end read tx on error of wal insert begin API
This commit is contained in:
@@ -1151,7 +1151,9 @@ impl Connection {
|
||||
result::LimboResult::Busy => return Err(LimboError::Busy),
|
||||
result::LimboResult::Ok => {}
|
||||
}
|
||||
match pager.io.block(|| pager.begin_write_tx())? {
|
||||
match pager.io.block(|| pager.begin_write_tx()).inspect_err(|_| {
|
||||
pager.end_read_tx().expect("read txn must be closed");
|
||||
})? {
|
||||
result::LimboResult::Busy => {
|
||||
pager.end_read_tx().expect("read txn must be closed");
|
||||
return Err(LimboError::Busy);
|
||||
|
||||
Reference in New Issue
Block a user