mirror of
https://github.com/chatmail/core.git
synced 2026-04-17 21:46:35 +03:00
Remove msgs_mdns references to deleted messages during housekeeping
This commit is contained in:
10
src/sql.rs
10
src/sql.rs
@@ -19,6 +19,7 @@ use crate::constants::DC_CHAT_ID_TRASH;
|
||||
use crate::context::Context;
|
||||
use crate::dc_tools::{dc_delete_file, time};
|
||||
use crate::ephemeral::start_ephemeral_timers;
|
||||
use crate::log::LogExt;
|
||||
use crate::message::{Message, Viewtype};
|
||||
use crate::param::{Param, Params};
|
||||
use crate::peerstate::{deduplicate_peerstates, Peerstate};
|
||||
@@ -650,6 +651,15 @@ pub async fn housekeeping(context: &Context) -> Result<()> {
|
||||
warn!(context, "Can't set config: {}", e);
|
||||
}
|
||||
|
||||
context
|
||||
.sql
|
||||
.execute(
|
||||
"DELETE FROM msgs_mdns WHERE msg_id NOT IN (SELECT id FROM msgs)",
|
||||
paramsv![],
|
||||
)
|
||||
.await
|
||||
.ok_or_log_msg(context, "failed to remove old MDNs");
|
||||
|
||||
info!(context, "Housekeeping done.");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user