ensure, that each config is only parsed once

This commit is contained in:
Willy Kloucek
2022-01-03 19:08:11 +01:00
committed by Jörn Friedrich Dreyer
parent 5b56920128
commit 1dc63cbce1
38 changed files with 70 additions and 262 deletions
+2 -6
View File
@@ -4,7 +4,6 @@ import (
"context"
"os"
"github.com/owncloud/ocis/graph/pkg/config/parser"
"github.com/owncloud/ocis/ocis-pkg/clihelper"
"github.com/thejerf/suture/v4"
@@ -30,11 +29,8 @@ func GetCommands(cfg *config.Config) cli.Commands {
// Execute is the entry point for the ocis-graph command.
func Execute(cfg *config.Config) error {
app := clihelper.DefaultApp(&cli.App{
Name: "ocis-graph",
Usage: "Serve Graph API for oCIS",
Before: func(c *cli.Context) error {
return parser.ParseConfig(cfg)
},
Name: "ocis-graph",
Usage: "Serve Graph API for oCIS",
Commands: GetCommands(cfg),
})
cli.HelpFlag = &cli.BoolFlag{
+2 -7
View File
@@ -20,13 +20,8 @@ func Server(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "server",
Usage: "Start integrated server",
Before: func(ctx *cli.Context) error {
if err := parser.ParseConfig(cfg); err != nil {
return err
}
return nil
Before: func(c *cli.Context) error {
return parser.ParseConfig(cfg)
},
Action: func(c *cli.Context) error {
logger := logging.Configure(cfg.Service.Name, cfg.Log)