Skip to content

Commit ee93881

Browse files
authored
Update rpcclient.go
1 parent e1cc1c1 commit ee93881

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

util/rpcclient/rpcclient.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import (
2121
"github.com/offchainlabs/nitro/util/signature"
2222
)
2323

24+
const DefaultExecKeepAliveInterval = time.Minute
25+
2426
type ClientConfig struct {
2527
URL string `json:"url,omitempty" koanf:"url"`
2628
JWTSecret string `json:"jwtsecret,omitempty" koanf:"jwtsecret"`
@@ -59,7 +61,7 @@ var TestClientConfig = ClientConfig{
5961
URL: "self",
6062
JWTSecret: "",
6163
WebsocketMessageSizeLimit: 256 * 1024 * 1024,
62-
ExecKeepAliveInterval: time.Minute,
64+
ExecKeepAliveInterval: DefaultExecKeepAliveInterval,
6365
}
6466

6567
var DefaultClientConfig = ClientConfig{
@@ -70,7 +72,7 @@ var DefaultClientConfig = ClientConfig{
7072
RetryErrors: "websocket: close.*|dial tcp .*|.*i/o timeout|.*connection reset by peer|.*connection refused",
7173
ArgLogLimit: 2048,
7274
WebsocketMessageSizeLimit: 256 * 1024 * 1024,
73-
ExecKeepAliveInterval: time.Minute,
75+
ExecKeepAliveInterval: DefaultExecKeepAliveInterval,
7476
}
7577

7678
func RPCClientAddOptions(prefix string, f *pflag.FlagSet, defaultConfig *ClientConfig) {
@@ -107,7 +109,7 @@ func (c *RpcClient) Timeout() time.Duration {
107109
func (c *RpcClient) ExecKeepAliveInterval() time.Duration {
108110
interval := c.config().ExecKeepAliveInterval
109111
if interval == 0 {
110-
return time.Minute
112+
return DefaultExecKeepAliveInterval
111113
}
112114
return interval
113115
}

0 commit comments

Comments
 (0)