chore(db): add ability to wait for programmatically started database maintenance, query last maintenance time (#10565)

Also adds a method to query the last database maintenance time.

Signed-off-by: Tommy van der Vorst <tommy@pixelspark.nl>
Co-authored-by: Jakob Borg <jakob@kastelo.net>
This commit is contained in:
Tommy van der Vorst
2026-02-11 09:28:11 +00:00
committed by GitHub
co-authored by Jakob Borg
parent 0b5a08c99a
commit 5cf9168dc2
3 changed files with 33 additions and 9 deletions
+8 -2
View File
@@ -116,8 +116,14 @@ func (a *App) Start() error {
}
// StartMaintenance asynchronously triggers database maintenance to start.
func (a *App) StartMaintenance() {
a.dbService.StartMaintenance()
func (a *App) StartMaintenance() <-chan error {
return a.dbService.StartMaintenance()
}
// LastMaintenanceTime returns the last time database maintenance completed successfully
// This will return time zero when database maintenance has never completed successfully.
func (a *App) LastMaintenanceTime() time.Time {
return a.dbService.LastMaintenanceTime()
}
func (a *App) startup() error {