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
// pointer to a TemplateRequest may be provided.
func NewSetGenerateCmd(id interface{}, generate bool, optArgs ...int) (*SetGenerateCmd, error) {
genproclimit := 0
genproclimit := -1
if len(optArgs) > 1 {
return nil, ErrTooManyOptArgs
}
@ -5758,7 +5757,7 @@ func (cmd *SetGenerateCmd) Method() string {
func (cmd *SetGenerateCmd) MarshalJSON() ([]byte, error) {
params := make([]interface{}, 1, 2)
params[0] = cmd.Generate
if cmd.GenProcLimit != 0 {
if cmd.GenProcLimit != -1 {
params = append(params, cmd.GenProcLimit)
}

View file

@ -1361,6 +1361,7 @@ var jsoncmdtests = []struct {
result: &SetGenerateCmd{
id: testId,
Generate: true,
GenProcLimit: -1,
},
},
{