fix/355-increase-tree-service-client-cache-size #359

Closed
ale64bit wants to merge 156 commits from ale64bit/frostfs-node:fix/355-increase-tree-service-client-cache-size into support/v0.36
2 changed files with 9 additions and 5 deletions
Showing only changes of commit eb7be82e87 - Show all commits

View file

@ -35,7 +35,11 @@ type Prm struct{}
// configuration values are read from it. // configuration values are read from it.
// Otherwise, Config is a degenerate tree. // Otherwise, Config is a degenerate tree.
func New(_ Prm, opts ...configViper.Option) *Config { func New(_ Prm, opts ...configViper.Option) *Config {
v, o := configViper.CreateViper(opts...) v, o, err := configViper.CreateViper(opts...)
if err != nil {
panic(err)
}
return &Config{ return &Config{
v: v, v: v,

View file

@ -15,7 +15,7 @@ const (
EnvSeparator = "_" EnvSeparator = "_"
) )
func CreateViper(opts ...Option) (*viper.Viper, *Opts) { func CreateViper(opts ...Option) (*viper.Viper, *Opts, error) {
v := viper.New() v := viper.New()
o := DefaultOpts() o := DefaultOpts()
@ -34,17 +34,17 @@ func CreateViper(opts ...Option) (*viper.Viper, *Opts) {
err := v.ReadInConfig() err := v.ReadInConfig()
if err != nil { if err != nil {
panic(fmt.Errorf("failed to read config: %w", err)) return nil, nil, fmt.Errorf("failed to read config: %w", err)
} }
} }
if o.ConfigDir != "" { if o.ConfigDir != "" {
if err := config.ReadConfigDir(v, o.ConfigDir); err != nil { if err := config.ReadConfigDir(v, o.ConfigDir); err != nil {
panic(fmt.Errorf("failed to read config dir: %w", err)) return nil, nil, fmt.Errorf("failed to read config dir: %w", err)
} }
} }
return v, o return v, o, nil
} }
func ReloadViper(v *viper.Viper, o Opts) error { func ReloadViper(v *viper.Viper, o Opts) error {