Skip to content

Commit

Permalink
Merge pull request #2013 from OffchainLabs/rpcclient_retry_default
Browse files Browse the repository at this point in the history
Rpcclient retry default
  • Loading branch information
joshuacolvin0 authored Dec 11, 2023
2 parents 629d0ae + 67d99d3 commit 1de9e02
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 2 additions & 0 deletions util/rpcclient/rpcclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ var TestClientConfig = ClientConfig{
var DefaultClientConfig = ClientConfig{
URL: "self-auth",
JWTSecret: "",
Retries: 3,
RetryErrors: "websocket: close.*|dial tcp .*|.*i/o timeout|.*connection reset by peer|.*connection refused",
ArgLogLimit: 2048,
}

Expand Down
13 changes: 5 additions & 8 deletions util/rpcclient/rpcclient_toxiproxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,12 @@ func TestToxiRpcClient(t *testing.T) {
Require(t, err)
defer proxy.Delete()

config := &ClientConfig{
URL: "ws://" + proxy.Listen,
Timeout: time.Second * 5,
Retries: 3,
RetryErrors: "websocket: close.*|.* i/o timeout|.*connection reset by peer|dial tcp .*",
RetryDelay: time.Millisecond * 500,
}
config := DefaultClientConfig
config.URL = "ws://" + proxy.Listen
config.Timeout = time.Second * 5
config.RetryDelay = time.Millisecond * 500
Require(t, config.Validate())
configFetcher := func() *ClientConfig { return config }
configFetcher := func() *ClientConfig { return &config }

client := NewRpcClient(configFetcher, server1)

Expand Down

0 comments on commit 1de9e02

Please sign in to comment.