Ensure read-only transactions are cancelled when complete

This commit is contained in:
Tobie Morgan Hitchcock 2022-08-29 12:29:38 +01:00
parent 8d08c34ddf
commit f22d5d3e51

View file

@ -255,7 +255,10 @@ impl<'a> Executor<'a> {
};
// Finalise transaction
match &res {
Ok(_) => self.commit(loc).await,
Ok(_) => match stm.writeable() {
true => self.commit(loc).await,
false => self.cancel(loc).await,
},
Err(_) => self.cancel(loc).await,
};
// Return the result