mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 01:16:31 +03:00
add_imap_deletion_jobs: check only for DeleteMsgOnImap jobs
Other jobs may have different meaning for foreign_id. Also removed " \" at the end of lines.
This commit is contained in:
11
src/job.rs
11
src/job.rs
@@ -946,11 +946,12 @@ fn add_imap_deletion_jobs(context: &Context) -> sql::Result<()> {
|
|||||||
// Select all expired messages which don't have a
|
// Select all expired messages which don't have a
|
||||||
// corresponding message deletion job yet.
|
// corresponding message deletion job yet.
|
||||||
let msg_ids = context.sql.query_map(
|
let msg_ids = context.sql.query_map(
|
||||||
"SELECT id FROM msgs \
|
"SELECT id FROM msgs
|
||||||
WHERE timestamp < ? \
|
WHERE timestamp < ?
|
||||||
AND server_uid != 0 \
|
AND server_uid != 0
|
||||||
AND NOT EXISTS (SELECT 1 FROM jobs WHERE foreign_id = msgs.id)",
|
AND NOT EXISTS (SELECT 1 FROM jobs WHERE foreign_id = msgs.id
|
||||||
params![threshold_timestamp],
|
AND action = ?)",
|
||||||
|
params![threshold_timestamp, Action::DeleteMsgOnImap],
|
||||||
|row| row.get::<_, MsgId>(0),
|
|row| row.get::<_, MsgId>(0),
|
||||||
|ids| {
|
|ids| {
|
||||||
ids.collect::<std::result::Result<Vec<_>, _>>()
|
ids.collect::<std::result::Result<Vec<_>, _>>()
|
||||||
|
|||||||
Reference in New Issue
Block a user