Use default genproclimit of -1 on setgenerate RPC.
The correct default for the genproclimit on the setgenerate RPC is -1. ok @jcvernaleo.
This commit is contained in:
parent
93f5aab0db
commit
ac5cc1d64e
2 changed files with 5 additions and 5 deletions
|
@ -5728,8 +5728,7 @@ var _ Cmd = &SetGenerateCmd{}
|
||||||
// NewSetGenerateCmd creates a new SetGenerateCmd. Optionally a
|
// NewSetGenerateCmd creates a new SetGenerateCmd. Optionally a
|
||||||
// pointer to a TemplateRequest may be provided.
|
// pointer to a TemplateRequest may be provided.
|
||||||
func NewSetGenerateCmd(id interface{}, generate bool, optArgs ...int) (*SetGenerateCmd, error) {
|
func NewSetGenerateCmd(id interface{}, generate bool, optArgs ...int) (*SetGenerateCmd, error) {
|
||||||
|
genproclimit := -1
|
||||||
genproclimit := 0
|
|
||||||
if len(optArgs) > 1 {
|
if len(optArgs) > 1 {
|
||||||
return nil, ErrTooManyOptArgs
|
return nil, ErrTooManyOptArgs
|
||||||
}
|
}
|
||||||
|
@ -5758,7 +5757,7 @@ func (cmd *SetGenerateCmd) Method() string {
|
||||||
func (cmd *SetGenerateCmd) MarshalJSON() ([]byte, error) {
|
func (cmd *SetGenerateCmd) MarshalJSON() ([]byte, error) {
|
||||||
params := make([]interface{}, 1, 2)
|
params := make([]interface{}, 1, 2)
|
||||||
params[0] = cmd.Generate
|
params[0] = cmd.Generate
|
||||||
if cmd.GenProcLimit != 0 {
|
if cmd.GenProcLimit != -1 {
|
||||||
params = append(params, cmd.GenProcLimit)
|
params = append(params, cmd.GenProcLimit)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1361,6 +1361,7 @@ var jsoncmdtests = []struct {
|
||||||
result: &SetGenerateCmd{
|
result: &SetGenerateCmd{
|
||||||
id: testId,
|
id: testId,
|
||||||
Generate: true,
|
Generate: true,
|
||||||
|
GenProcLimit: -1,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue