aboutsummaryrefslogtreecommitdiff
path: root/src/mail
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2023-12-19 19:02:22 +0100
committerQuentin Dufour <quentin@deuxfleurs.fr>2023-12-19 19:02:22 +0100
commitc75f2d91ff969dd791cb476031ee80870c6ad61a (patch)
treeb8da577a6a932d82a28d29b7ab98f9cc696d4ff5 /src/mail
parent3d41f40dc8cd6bdfa7a9279ab1959564d06eefaf (diff)
downloadaerogramme-c75f2d91ff969dd791cb476031ee80870c6ad61a.tar.gz
aerogramme-c75f2d91ff969dd791cb476031ee80870c6ad61a.zip
implemented an in memory storage
Diffstat (limited to 'src/mail')
-rw-r--r--src/mail/incoming.rs2
-rw-r--r--src/mail/mailbox.rs7
2 files changed, 7 insertions, 2 deletions
diff --git a/src/mail/incoming.rs b/src/mail/incoming.rs
index f6b831d..2a6c947 100644
--- a/src/mail/incoming.rs
+++ b/src/mail/incoming.rs
@@ -386,7 +386,7 @@ async fn k2v_lock_loop_internal(
_ => None,
};
if let Some(ct) = release {
- match storage.row_rm(&storage::Selector::Single(&ct)).await {
+ match storage.row_rm_single(&ct).await {
Err(e) => warn!("Unable to release lock {:?}: {}", ct, e),
Ok(_) => (),
};
diff --git a/src/mail/mailbox.rs b/src/mail/mailbox.rs
index b4afd5e..65f44b1 100644
--- a/src/mail/mailbox.rs
+++ b/src/mail/mailbox.rs
@@ -361,7 +361,12 @@ impl MailboxInternal {
async {
// Delete mail meta from K2V
let sk = ident.to_string();
- self.storage.row_rm(&Selector::Single(&RowRef::new(&self.mail_path, &sk))).await?;
+ let res = self.storage
+ .row_fetch(&storage::Selector::Single(&RowRef::new(&self.mail_path, &sk)))
+ .await?;
+ if let Some(row_val) = res.into_iter().next() {
+ self.storage.row_rm_single(&row_val.row_ref).await?;
+ }
Ok::<_, anyhow::Error>(())
}
)?;