use new channelmonitor.Config

This commit is contained in:
Anton Evangelatov
2021-03-19 13:53:03 +02:00
parent af8104830c
commit 86772a09c7
4 changed files with 35 additions and 15 deletions
-3
View File
@@ -7,7 +7,6 @@ import (
"io"
"os"
"github.com/davecgh/go-spew/spew"
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
"golang.org/x/xerrors"
@@ -216,8 +215,6 @@ func (a *API) ClientListDeals(ctx context.Context) ([]api.DealInfo, error) {
out[k] = a.newDealInfoWithTransfer(transferCh, v)
}
spew.Dump(out)
return out, nil
}
+12 -2
View File
@@ -13,6 +13,7 @@ import (
"go.uber.org/fx"
"github.com/filecoin-project/go-data-transfer/channelmonitor"
dtimpl "github.com/filecoin-project/go-data-transfer/impl"
dtnet "github.com/filecoin-project/go-data-transfer/network"
dtgstransport "github.com/filecoin-project/go-data-transfer/transport/graphsync"
@@ -136,8 +137,17 @@ func NewClientGraphsyncDataTransfer(lc fx.Lifecycle, h host.Host, gs dtypes.Grap
}
// data-transfer push channel restart configuration
dtRestartConfig := dtimpl.PushChannelRestartConfig(time.Minute, 10, 1024, 10*time.Minute, 3)
dt, err := dtimpl.NewDataTransfer(dtDs, filepath.Join(r.Path(), "data-transfer"), net, transport, sc, dtRestartConfig)
dtRestartConf := dtimpl.ChannelRestartConfig(channelmonitor.Config{
AcceptTimeout: 100 * time.Millisecond,
Interval: 100 * time.Millisecond,
MinBytesTransferred: 1,
ChecksPerInterval: 10,
RestartBackoff: 500 * time.Millisecond,
MaxConsecutiveRestarts: 5,
CompleteTimeout: 100 * time.Millisecond,
})
//dtRestartConfig := dtimpl.PushChannelRestartConfig(time.Minute, 10, 1024, 10*time.Minute, 3)
dt, err := dtimpl.NewDataTransfer(dtDs, filepath.Join(r.Path(), "data-transfer"), net, transport, sc, dtRestartConf)
if err != nil {
return nil, err
}