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:
Dave Collins 2014-06-11 21:56:59 -05:00
parent 93f5aab0db
commit ac5cc1d64e
2 changed files with 5 additions and 5 deletions

View file

@ -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)
} }

View file

@ -1359,8 +1359,9 @@ var jsoncmdtests = []struct {
return NewSetGenerateCmd(testId, true) return NewSetGenerateCmd(testId, true)
}, },
result: &SetGenerateCmd{ result: &SetGenerateCmd{
id: testId, id: testId,
Generate: true, Generate: true,
GenProcLimit: -1,
}, },
}, },
{ {