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:
co-authored by
Jakob Borg
parent
0b5a08c99a
commit
5cf9168dc2
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user