From ac5cc1d64ee48460cd4c65a2b537e4846c424911 Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Wed, 11 Jun 2014 21:56:59 -0500 Subject: [PATCH] Use default genproclimit of -1 on setgenerate RPC. The correct default for the genproclimit on the setgenerate RPC is -1. ok @jcvernaleo. --- jsoncmd.go | 5 ++--- jsoncmd_test.go | 5 +++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/jsoncmd.go b/jsoncmd.go index 5c9eae12..8cc0df22 100644 --- a/jsoncmd.go +++ b/jsoncmd.go @@ -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) } diff --git a/jsoncmd_test.go b/jsoncmd_test.go index cbd2ac41..ab4f9c12 100644 --- a/jsoncmd_test.go +++ b/jsoncmd_test.go @@ -1359,8 +1359,9 @@ var jsoncmdtests = []struct { return NewSetGenerateCmd(testId, true) }, result: &SetGenerateCmd{ - id: testId, - Generate: true, + id: testId, + Generate: true, + GenProcLimit: -1, }, }, {