fix: Save msgs to key-contacts migration state and run migration periodically (#6956)

Save:
- (old contact id) -> (new contact id) mapping.
- The message id starting from which all messages are already migrated.
Run the migration from `housekeeping()` for at least 500 ms and for >= 1000 messages per run.
This commit is contained in:
iequidoo
2025-07-06 16:40:16 -03:00
committed by iequidoo
parent a87ee030fc
commit 389649ea8a
5 changed files with 128 additions and 53 deletions

View File

@@ -257,6 +257,9 @@ pub(crate) const ASM_BODY: &str = "This is the Autocrypt Setup Message \
If you see this message in a chatmail client (Delta Chat, Arcane Chat, Delta Touch ...), \
use \"Settings / Add Second Device\" instead.";
/// Period between `sql::housekeeping()` runs.
pub(crate) const HOUSEKEEPING_PERIOD: i64 = 24 * 60 * 60;
#[cfg(test)]
mod tests {
use num_traits::FromPrimitive;