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.
This commit is contained in:
iequidoo
2025-08-17 13:42:40 -03:00
parent 0e30dd895f
commit 782a4ddeb7

View File

@@ -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())