Limit number of concurrent goroutines
This commit is contained in:
parent
5fd9bc851b
commit
62dadc53bf
12 changed files with 206 additions and 103 deletions
|
|
@ -48,6 +48,11 @@ func ParseCliArguments(name, description string, arguments []string) (CliArgumen
|
|||
Help: "Limit actions to repositories that contain specific tags",
|
||||
})
|
||||
|
||||
limitRoutines := parser.Int("", "max-concurrent-process", &argparse.Options{
|
||||
Default: 10,
|
||||
Help: "Determine how many tasks can run simultaneously",
|
||||
})
|
||||
|
||||
if err := parser.Parse(arguments); err != nil {
|
||||
return CliArguments{}, errors.New(parser.Usage("Please follow this help"))
|
||||
}
|
||||
|
|
@ -66,7 +71,8 @@ func ParseCliArguments(name, description string, arguments []string) (CliArgumen
|
|||
Status: statusCMD.Happened(),
|
||||
Version: *version,
|
||||
Color: !(*color),
|
||||
LimitName: *limitName,
|
||||
LimitTags: *limitTags,
|
||||
LimitToName: *limitName,
|
||||
LimitToTags: *limitTags,
|
||||
Routines: *limitRoutines,
|
||||
}, nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ type CliArguments struct {
|
|||
Status bool
|
||||
Version bool
|
||||
Color bool
|
||||
LimitName string
|
||||
LimitTags []string
|
||||
LimitToName string
|
||||
LimitToTags []string
|
||||
Routines int
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue