Skip to content

Commit

Permalink
fixup! rpcclient: add timeout for http request.
Browse files Browse the repository at this point in the history
  • Loading branch information
ziggie1984 committed Oct 2, 2024
1 parent cc4d6a3 commit 6b4ef69
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions rpcclient/infrastructure.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ const (
// retries when sending HTTP POST requests.
requestRetryInterval = time.Millisecond * 500

// defaultHttpTimeout is the default timeout for an http request, so the
// request does not block indefintily.
defaultHttpTimeout = time.Second * 2
// defaultHTTPTimeout is the default timeout for an http request, so the
// request does not block indefinitely.
defaultHTTPTimeout = time.Second * 10
)

// jsonRequest holds information about a json request that is used to properly
Expand Down Expand Up @@ -1367,7 +1367,7 @@ func newHTTPClient(config *ConnConfig) (*http.Client, error) {
return net.Dial(parsedAddr.Network(), parsedAddr.String())
},
},
Timeout: defaultHttpTimeout,
Timeout: defaultHTTPTimeout,
}

return &client, nil
Expand Down

0 comments on commit 6b4ef69

Please sign in to comment.