Skip to content

Commit

Permalink
fix(config): fix task.handler.maxRunners set error
Browse files Browse the repository at this point in the history
  • Loading branch information
ma-pony committed Apr 25, 2023
1 parent 3f9dc67 commit d45536e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions node/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ type Options struct {
MaxRunners int
}

var DefaultMaxRunner = 8

var DefaultConfigOptions = &Options{
Key: utils.NewUUIDString(),
IsMaster: utils.IsMaster(),
AuthKey: constants.DefaultGrpcAuthKey,
MaxRunners: 8,
MaxRunners: 0,
}

func NewConfig(opts *Options) (cfg *Config) {
Expand Down Expand Up @@ -53,7 +55,7 @@ func NewConfig(opts *Options) (cfg *Config) {
if viper.GetInt("task.handler.maxRunners") != 0 {
opts.MaxRunners = viper.GetInt("task.handler.maxRunners")
} else {
opts.MaxRunners = DefaultConfigOptions.MaxRunners
opts.MaxRunners = DefaultMaxRunner
}
}
return &Config{
Expand Down

0 comments on commit d45536e

Please sign in to comment.