run ParseConfig only when running unsupervised

This commit is contained in:
A.Unger
2021-03-11 20:09:05 +01:00
parent dc4b4b7e46
commit b52fe95762
13 changed files with 80 additions and 42 deletions
+7 -2
View File
@@ -29,12 +29,17 @@ func Server(cfg *config.Config) *cli.Command {
Name: "server",
Usage: "Start integrated server",
Flags: flagset.ServerWithConfig(cfg),
Before: func(c *cli.Context) error {
Before: func(ctx *cli.Context) error {
logger := NewLogger(cfg)
if cfg.HTTP.Root != "/" {
cfg.HTTP.Root = strings.TrimSuffix(cfg.HTTP.Root, "/")
}
return ParseConfig(c, cfg)
if !cfg.Supervised {
return ParseConfig(ctx, cfg)
}
logger.Debug().Str("service", "ocs").Msg("ignoring config file parsing when running supervised")
return nil
},
Action: func(c *cli.Context) error {
logger := NewLogger(cfg)