mirror of
https://github.com/project-zot/zot.git
synced 2026-06-15 20:07:55 +08:00
lint: Move out config reloader context from controller struct
Signed-off-by: Petu Eusebiu <peusebiu@cisco.com>
This commit is contained in:
committed by
Ramkumar Chinchani
parent
353b0c6034
commit
be910cf01c
+6
-3
@@ -44,14 +44,17 @@ func newServeCmd(conf *config.Config) *cobra.Command {
|
||||
|
||||
ctlr := api.NewController(conf)
|
||||
|
||||
// config reloader
|
||||
hotReloader, err := NewHotReloader(ctlr, args[0])
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
hotReloader.Start()
|
||||
/* context used to cancel go routines so that
|
||||
we can change their config on the fly (restart routines with different config) */
|
||||
reloaderCtx := hotReloader.Start()
|
||||
|
||||
if err := ctlr.Run(); err != nil {
|
||||
if err := ctlr.Run(reloaderCtx); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
},
|
||||
@@ -100,7 +103,7 @@ func newScrubCmd(conf *config.Config) *cobra.Command {
|
||||
ctlr := api.NewController(conf)
|
||||
ctlr.Metrics = monitoring.NewMetricsServer(false, ctlr.Log)
|
||||
|
||||
if err := ctlr.InitImageStore(); err != nil {
|
||||
if err := ctlr.InitImageStore(context.Background()); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user