aboutsummaryrefslogtreecommitdiff
path: root/src/block/rc.rs
diff options
context:
space:
mode:
authorAlex <alex@adnab.me>2023-09-21 14:03:35 +0000
committerAlex <alex@adnab.me>2023-09-21 14:03:35 +0000
commit1d986bd889a5f5fe1bdc75e7d4b34acc2cfbe09f (patch)
tree5b5f8d66637c4a10866b00e07a45081c93cf75cf /src/block/rc.rs
parentfd7d8fec59c617b40e480ff855894cf35fdcfb40 (diff)
parent0635250b2bdcce4156704128de154f9052d34e9e (diff)
downloadgarage-1d986bd889a5f5fe1bdc75e7d4b34acc2cfbe09f.tar.gz
garage-1d986bd889a5f5fe1bdc75e7d4b34acc2cfbe09f.zip
Merge pull request 'Refactor db transactions and add on_commit for table.queue_insert' (#637) from k2v-indices-lmdb into next
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/637
Diffstat (limited to 'src/block/rc.rs')
-rw-r--r--src/block/rc.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/block/rc.rs b/src/block/rc.rs
index 94cb5eea..b6afb277 100644
--- a/src/block/rc.rs
+++ b/src/block/rc.rs
@@ -56,7 +56,7 @@ impl BlockRc {
/// deletion time has passed
pub(crate) fn clear_deleted_block_rc(&self, hash: &Hash) -> Result<(), Error> {
let now = now_msec();
- self.rc.db().transaction(|mut tx| {
+ self.rc.db().transaction(|tx| {
let rcval = RcEntry::parse_opt(tx.get(&self.rc, hash)?);
match rcval {
RcEntry::Deletable { at_time } if now > at_time => {
@@ -64,7 +64,7 @@ impl BlockRc {
}
_ => (),
};
- tx.commit(())
+ Ok(())
})?;
Ok(())
}