Skip to content

Commit 70e5990

Browse files
committed
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.
1 parent 91a4cb4 commit 70e5990

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/sql.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,12 @@ impl Sql {
277277
info!(context, "Opened database {:?}.", self.dbfile);
278278
*self.is_encrypted.write().await = Some(passphrase_nonempty);
279279

280+
// Some migrations want housekeeping to run. Also if housekeeping failed before, fixing the
281+
// reason and restarting the program is the most natural way to retry it.
282+
context
283+
.set_config_internal(Config::LastHousekeeping, None)
284+
.await?;
285+
280286
// setup debug logging if there is an entry containing its id
281287
if let Some(xdc_id) = self
282288
.get_raw_config_u32(Config::DebugLogging.as_ref())

0 commit comments

Comments
 (0)