fix: close metadb on shutdown (#3277)

Fixes https://github.com/project-zot/helm-charts/issues/70

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
This commit is contained in:
Ramkumar Chinchani
2025-07-29 09:27:26 -07:00
committed by GitHub
parent 966d4584ba
commit b2a5afc5c8
7 changed files with 41 additions and 0 deletions
+6
View File
@@ -455,12 +455,18 @@ func (c *Controller) LoadNewConfig(newConfig *config.Config) {
}
func (c *Controller) Shutdown() {
// stop all background tasks
c.StopBackgroundTasks()
if c.Server != nil {
ctx := context.Background()
_ = c.Server.Shutdown(ctx)
}
// close metadb
if c.MetaDB != nil {
c.MetaDB.Close()
}
}
// Will stop scheduler and wait for all tasks to finish their work.