diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2023-11-17 15:02:43 +0100 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2023-11-17 15:02:43 +0100 |
commit | e92dc35564e91ce4e6a8defa9e8b52eef9e55fae (patch) | |
tree | bf33563e7858c5b8b6865c89558b2e0d305b3dec /src/mail/incoming.rs | |
parent | 4a33ac2265dae0e8fd1f7fbaec54ab7120334cbe (diff) | |
download | aerogramme-e92dc35564e91ce4e6a8defa9e8b52eef9e55fae.tar.gz aerogramme-e92dc35564e91ce4e6a8defa9e8b52eef9e55fae.zip |
fix orphan storage compatibility
Diffstat (limited to 'src/mail/incoming.rs')
-rw-r--r-- | src/mail/incoming.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mail/incoming.rs b/src/mail/incoming.rs index db22f3e..da4c819 100644 --- a/src/mail/incoming.rs +++ b/src/mail/incoming.rs @@ -77,7 +77,7 @@ async fn incoming_mail_watch_process_internal( tokio::select! { inc_k = wait_new_mail => Some(inc_k), - _ = tokio::time::sleep(MAIL_CHECK_INTERVAL) => Some(k2v.from_orphan(incoming_key.to_orphan())), + _ = tokio::time::sleep(MAIL_CHECK_INTERVAL) => Some(k2v.from_orphan(incoming_key.to_orphan()).expect("Incompatible source & target storage")), _ = lock_held.changed() => None, _ = rx_inbox_id.changed() => None, } @@ -358,7 +358,7 @@ async fn k2v_lock_loop_internal( )); lock[8..].copy_from_slice(&our_pid.0); let row = match ct { - Some(orphan) => k2v.from_orphan(orphan), + Some(orphan) => k2v.from_orphan(orphan).expect("Source & target must be storage compatible"), None => k2v.row(pk, sk), }; if let Err(e) = row.set_value(lock).push().await { @@ -387,7 +387,7 @@ async fn k2v_lock_loop_internal( _ => None, }; if let Some(ct) = release { - let row = k2v.from_orphan(ct); + let row = k2v.from_orphan(ct).expect("Incompatible source & target storage"); let _ = row.rm().await; } } |