mirror of
https://github.com/chatmail/core.git
synced 2026-05-05 14:26:30 +03:00
Do not ignore database read errors in precheck_imf
If precheck_imf fails to check if message with the same rfc724_mid already exists, the same message may be downloaded twice. Instead, abort the whole operation and retry later.
This commit is contained in:
committed by
Alexander Krotov
parent
4e828199c8
commit
979d7c5625
@@ -1431,12 +1431,12 @@ pub fn rfc724_mid_cnt(context: &Context, rfc724_mid: &str) -> i32 {
|
||||
pub(crate) fn rfc724_mid_exists(
|
||||
context: &Context,
|
||||
rfc724_mid: &str,
|
||||
) -> Result<(String, u32, MsgId), Error> {
|
||||
) -> Result<Option<(String, u32, MsgId)>, Error> {
|
||||
ensure!(!rfc724_mid.is_empty(), "empty rfc724_mid");
|
||||
|
||||
context
|
||||
.sql
|
||||
.query_row(
|
||||
.query_row_optional(
|
||||
"SELECT server_folder, server_uid, id FROM msgs WHERE rfc724_mid=?",
|
||||
&[rfc724_mid],
|
||||
|row| {
|
||||
|
||||
Reference in New Issue
Block a user