mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-11-30 02:38:17 +08:00
support set chaos max task number
This commit is contained in:
parent
4314844781
commit
a09142d088
@ -72,7 +72,12 @@ func NewManager(conf option.Config, mqc mqclient.MQClient) (Manager, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
maxConcurrentTask := runtime.NumCPU() * 2
|
||||
var maxConcurrentTask int
|
||||
if conf.MaxTasks == 0 {
|
||||
maxConcurrentTask = runtime.NumCPU() * 2
|
||||
} else {
|
||||
maxConcurrentTask = conf.MaxTasks
|
||||
}
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
logrus.Infof("The maximum number of concurrent build tasks supported by the current node is %d", maxConcurrentTask)
|
||||
return &exectorManager{
|
||||
|
@ -72,7 +72,7 @@ func (a *Builder) AddFlags(fs *pflag.FlagSet) {
|
||||
fs.StringVar(&a.MysqlConnectionInfo, "mysql", "root:admin@tcp(127.0.0.1:3306)/region", "mysql db connection info")
|
||||
fs.StringSliceVar(&a.EventLogServers, "event-servers", []string{"127.0.0.1:6366"}, "event log server address. simple lb")
|
||||
fs.StringVar(&a.KubeConfig, "kube-config", "/opt/rainbond/etc/kubernetes/kubecfg/admin.kubeconfig", "kubernetes api server config file")
|
||||
fs.IntVar(&a.MaxTasks, "max-tasks", 50, "the max tasks for per node")
|
||||
fs.IntVar(&a.MaxTasks, "max-tasks", 0, "Maximum number of simultaneous build tasks,If set to 0, the maximum limit is twice the number of CPU cores")
|
||||
fs.IntVar(&a.APIPort, "api-port", 3228, "the port for api server")
|
||||
fs.StringVar(&a.MQAPI, "mq-api", "127.0.0.1:6300", "acp_mq api")
|
||||
fs.StringVar(&a.RunMode, "run", "sync", "sync data when worker start")
|
||||
|
Loading…
Reference in New Issue
Block a user