mirror of
https://github.com/project-zot/zot.git
synced 2026-06-17 21:17:58 +08:00
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:
committed by
GitHub
parent
966d4584ba
commit
b2a5afc5c8
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user