Skip to content

Commit

Permalink
refactor: remove hardcoded timeout
Browse files Browse the repository at this point in the history
connectionTimeout here is not necessary since defaultNewStreamTimeout
was introduced upstream in libp2p/go-libp2p#2907
  • Loading branch information
lidel committed Aug 6, 2024
1 parent 39e81ec commit 9a14d24
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions bitswap/network/ipfs_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ import (

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

var connectTimeout = time.Second * 10

var (
maxSendTimeout = 2 * time.Minute
minSendTimeout = 10 * time.Second
Expand Down Expand Up @@ -323,10 +321,7 @@ func (bsnet *impl) SendMessage(
p peer.ID,
outgoing bsmsg.BitSwapMessage,
) error {
tctx, cancel := context.WithTimeout(ctx, connectTimeout)
defer cancel()

s, err := bsnet.newStreamToPeer(tctx, p)
s, err := bsnet.newStreamToPeer(ctx, p)
if err != nil {
return err
}
Expand Down

0 comments on commit 9a14d24

Please sign in to comment.