fix debug services shutdown

This commit is contained in:
A.Unger
2021-03-10 11:38:21 +01:00
parent 4e37d4a2f6
commit e8c57394d8
12 changed files with 38 additions and 114 deletions
+7 -2
View File
@@ -115,8 +115,13 @@ func Server(cfg *config.Config) *cli.Command {
}
var (
gr = run.Group{}
ctx, cancel = context.WithCancel(context.Background())
mtrcs = metrics.New()
ctx, cancel = func() (context.Context, context.CancelFunc) {
if cfg.Context == nil {
return context.WithCancel(context.Background())
}
return context.WithCancel(cfg.Context)
}()
mtrcs = metrics.New()
)
defer cancel()