mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-02-16 10:29:34 -06:00
ensure, that each config is only parsed once
This commit is contained in:
committed by
Jörn Friedrich Dreyer
parent
5b56920128
commit
1dc63cbce1
@@ -5,6 +5,7 @@ import (
|
||||
"net/http"
|
||||
|
||||
"github.com/owncloud/ocis/proxy/pkg/config"
|
||||
"github.com/owncloud/ocis/proxy/pkg/config/parser"
|
||||
"github.com/owncloud/ocis/proxy/pkg/logging"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
@@ -14,7 +15,9 @@ func Health(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "health",
|
||||
Usage: "Check health status",
|
||||
//Flags: flagset.HealthWithConfig(cfg),
|
||||
Before: func(c *cli.Context) error {
|
||||
return parser.ParseConfig(cfg)
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
logger := logging.Configure(cfg.Service.Name, cfg.Log)
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ import (
|
||||
"github.com/owncloud/ocis/ocis-pkg/clihelper"
|
||||
ociscfg "github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/proxy/pkg/config"
|
||||
"github.com/owncloud/ocis/proxy/pkg/config/parser"
|
||||
"github.com/thejerf/suture/v4"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
@@ -29,11 +28,8 @@ func GetCommands(cfg *config.Config) cli.Commands {
|
||||
// Execute is the entry point for the ocis-proxy command.
|
||||
func Execute(cfg *config.Config) error {
|
||||
app := clihelper.DefaultApp(&cli.App{
|
||||
Name: "ocis-proxy",
|
||||
Usage: "proxy for oCIS",
|
||||
Before: func(c *cli.Context) error {
|
||||
return parser.ParseConfig(cfg)
|
||||
},
|
||||
Name: "ocis-proxy",
|
||||
Usage: "proxy for oCIS",
|
||||
Commands: GetCommands(cfg),
|
||||
})
|
||||
|
||||
|
||||
@@ -38,11 +38,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)
|
||||
|
||||
Reference in New Issue
Block a user