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:
Alexander Krotov
2020-04-23 00:11:32 +03:00
committed by Alexander Krotov
parent 4e828199c8
commit 979d7c5625
3 changed files with 15 additions and 10 deletions

View File

@@ -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| {