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)
@ -61,7 +61,7 @@ func TestReaderProxy(t *testing.T) {
func TestNullReaderProxy(t *testing.T) {
var client struct {
ReadAll func(ctx context.Context, r io.Reader) ([]byte, error)
ReadAll func(ctx context.Context, r io.Reader) ([]byte, error)
ReadNullLen func(ctx context.Context, r io.Reader) (int64, error)
}
@ -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)

View File

@ -323,9 +323,9 @@ func (s *WindowPoStScheduler) runPost(ctx context.Context, di miner.DeadlineInfo
}
params := &miner.SubmitWindowedPoStParams{
Deadline: di.Index,
Partitions: make([]miner.PoStPartition, 0, len(partitions)),
Proofs: nil,
Deadline: di.Index,
Partitions: make([]miner.PoStPartition, 0, len(partitions)),
Proofs: nil,
}
var sinfos []abi.SectorInfo