From 782a4ddeb7a1d06b7303f62252ad0a1911967e96 Mon Sep 17 00:00:00 2001 From: iequidoo Date: Sun, 17 Aug 2025 13:42:40 -0300 Subject: [PATCH] feat: Trigger housekeeping after opening db Some migrations want housekeeping to run. Also if housekeeping failed before, fixing the reason and restarting the program is the most natural way to retry it. --- src/sql.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/sql.rs b/src/sql.rs index 69fefc7d3..009a8e8b6 100644 --- a/src/sql.rs +++ b/src/sql.rs @@ -277,6 +277,12 @@ impl Sql { info!(context, "Opened database {:?}.", self.dbfile); *self.is_encrypted.write().await = Some(passphrase_nonempty); + // Some migrations want housekeeping to run. Also if housekeeping failed before, fixing the + // reason and restarting the program is the most natural way to retry it. + context + .set_config_internal(Config::LastHousekeeping, None) + .await?; + // setup debug logging if there is an entry containing its id if let Some(xdc_id) = self .get_raw_config_u32(Config::DebugLogging.as_ref())