This commit is contained in:
Łukasz Magiera 2020-08-14 23:40:41 +02:00
parent 1ecec49885
commit 42bb91c2e6
4 changed files with 8 additions and 7 deletions

View File

@ -75,7 +75,7 @@ func NewWorkerRPC(addr string, requestHeader http.Header) (api.WorkerAPI, jsonrp
requestHeader,
rpcenc.ReaderParamEncoder(u.String()),
jsonrpc.WithNoReconnect(),
jsonrpc.WithWriteTimeout(30 * time.Second),
jsonrpc.WithWriteTimeout(30*time.Second),
)
return &res, closer, err

View File

@ -27,6 +27,7 @@ var log = logging.Logger("rpcenc")
var Timeout = 30 * time.Second
type StreamType string
const (
Null StreamType = "null"
PushStream StreamType = "push"

View File

@ -48,7 +48,7 @@ func TestReaderProxy(t *testing.T) {
testServ := httptest.NewServer(mux)
defer testServ.Close()
re := ReaderParamEncoder("http://"+testServ.Listener.Addr().String()+"/rpc/streams/v0/push")
re := ReaderParamEncoder("http://" + testServ.Listener.Addr().String() + "/rpc/streams/v0/push")
closer, err := jsonrpc.NewMergeClient("ws://"+testServ.Listener.Addr().String()+"/rpc/v0", "ReaderHandler", []interface{}{&client}, nil, re)
require.NoError(t, err)
@ -78,7 +78,7 @@ func TestNullReaderProxy(t *testing.T) {
testServ := httptest.NewServer(mux)
defer testServ.Close()
re := ReaderParamEncoder("http://"+testServ.Listener.Addr().String()+"/rpc/streams/v0/push")
re := ReaderParamEncoder("http://" + testServ.Listener.Addr().String() + "/rpc/streams/v0/push")
closer, err := jsonrpc.NewMergeClient("ws://"+testServ.Listener.Addr().String()+"/rpc/v0", "ReaderHandler", []interface{}{&client}, nil, re)
require.NoError(t, err)