mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-29 21:04:23 +01:00
Merge pull request #61 from penberg/fix59
database: fix an unwrap() in tx_commit
This commit is contained in:
@@ -515,7 +515,7 @@ impl<Clock: LogicalClock> Database<Clock> {
|
||||
let end_ts = self.get_timestamp();
|
||||
// NOTICE: the first shadowed tx keeps the entry alive in the map
|
||||
// for the duration of this whole function, which is important for correctness!
|
||||
let tx = self.txs.get(&tx_id).unwrap();
|
||||
let tx = self.txs.get(&tx_id).ok_or(DatabaseError::TxTerminated)?;
|
||||
let tx = tx.value().write().unwrap();
|
||||
match tx.state.load() {
|
||||
TransactionState::Terminated => return Err(DatabaseError::TxTerminated),
|
||||
|
||||
Reference in New Issue
Block a user