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
+6 -1
View File
@@ -30,9 +30,14 @@ func Server(cfg *config.Config) *cli.Command {
Usage: "Start integrated server",
Flags: flagset.ServerWithConfig(cfg),
Before: func(ctx *cli.Context) error {
logger := NewLogger(cfg)
// When running on single binary mode the before hook from the root command won't get called. We manually
// call this before hook from ocis command, so the configuration can be loaded.
return ParseConfig(ctx, cfg)
if !cfg.Supervised {
return ParseConfig(ctx, cfg)
}
logger.Debug().Str("service", "store").Msg("ignoring config file parsing when running supervised")
return nil
},
Action: func(c *cli.Context) error {
logger := NewLogger(cfg)