Skip to content

Commit 9a14d24

Browse files
committed
refactor: remove hardcoded timeout
connectionTimeout here is not necessary since defaultNewStreamTimeout was introduced upstream in libp2p/go-libp2p#2907
1 parent 39e81ec commit 9a14d24

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

bitswap/network/ipfs_impl.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ import (
2828

2929
var log = logging.Logger("bitswap/network")
3030

31-
var connectTimeout = time.Second * 10
32-
3331
var (
3432
maxSendTimeout = 2 * time.Minute
3533
minSendTimeout = 10 * time.Second
@@ -323,10 +321,7 @@ func (bsnet *impl) SendMessage(
323321
p peer.ID,
324322
outgoing bsmsg.BitSwapMessage,
325323
) error {
326-
tctx, cancel := context.WithTimeout(ctx, connectTimeout)
327-
defer cancel()
328-
329-
s, err := bsnet.newStreamToPeer(tctx, p)
324+
s, err := bsnet.newStreamToPeer(ctx, p)
330325
if err != nil {
331326
return err
332327
}

0 commit comments

Comments
 (0)