define method retry freq as a constant

Signed-off-by: jsign <jsign.uy@gmail.com>
This commit is contained in:
jsign 2020-01-26 21:52:19 -03:00
parent 54f2e6ea3a
commit 3106f512b2

View File

@ -19,11 +19,15 @@ import (
"golang.org/x/xerrors" "golang.org/x/xerrors"
) )
var log = logging.Logger("rpc") const (
methodRetryFrequency = time.Second * 3
)
var ( var (
errorType = reflect.TypeOf(new(error)).Elem() errorType = reflect.TypeOf(new(error)).Elem()
contextType = reflect.TypeOf(new(context.Context)).Elem() contextType = reflect.TypeOf(new(context.Context)).Elem()
log = logging.Logger("rpc")
) )
// ErrClient is an error which occurred on the client side the library // ErrClient is an error which occurred on the client side the library
@ -389,7 +393,7 @@ func (fn *rpcFunc) handleRpcCall(args []reflect.Value) (results []reflect.Value)
if !retry { if !retry {
break break
} }
time.Sleep(time.Second * 3) time.Sleep(methodRetryFrequency)
} }
return fn.processResponse(resp, retVal()) return fn.processResponse(resp, retVal())