adjust thumbnails

This commit is contained in:
A.Unger
2020-11-04 15:38:36 +01:00
parent 04cccd7651
commit 78d5f21587
2 changed files with 12 additions and 12 deletions

View File

@@ -33,7 +33,7 @@ func Execute() error {
Before: func(c *cli.Context) error {
cfg.Server.Version = version.String
return ParseConfig(c, cfg)
return nil
},
Commands: []*cli.Command{
@@ -88,22 +88,22 @@ func ParseConfig(c *cli.Context, cfg *config.Config) error {
switch err.(type) {
case viper.ConfigFileNotFoundError:
logger.Info().
Msg("Continue without config")
Msg("no config found on preconfigured location")
case viper.UnsupportedConfigError:
logger.Fatal().
Err(err).
Msg("Unsupported config type")
Msg("unsupported config type")
default:
logger.Fatal().
Err(err).
Msg("Failed to read config")
Msg("failed to read config")
}
}
if err := viper.Unmarshal(&cfg); err != nil {
logger.Fatal().
Err(err).
Msg("Failed to parse config")
Msg("failed to parse config")
}
return nil

View File

@@ -11,13 +11,6 @@ import (
// RootWithConfig applies cfg to the root flagset
func RootWithConfig(cfg *config.Config) []cli.Flag {
return []cli.Flag{
&cli.StringFlag{
Name: "config-file",
Value: "",
Usage: "Path to config file",
EnvVars: []string{"THUMBNAILS_CONFIG_FILE"},
Destination: &cfg.File,
},
&cli.StringFlag{
Name: "log-level",
Value: "info",
@@ -58,6 +51,13 @@ func HealthWithConfig(cfg *config.Config) []cli.Flag {
// ServerWithConfig applies cfg to the root flagset
func ServerWithConfig(cfg *config.Config) []cli.Flag {
return []cli.Flag{
&cli.StringFlag{
Name: "config-file",
Value: "",
Usage: "Path to config file",
EnvVars: []string{"THUMBNAILS_CONFIG_FILE"},
Destination: &cfg.File,
},
&cli.BoolFlag{
Name: "tracing-enabled",
Usage: "Enable sending traces",