You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/config.rs
+16Lines changed: 16 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,7 @@ use std::net::SocketAddr;
5
5
use std::net::ToSocketAddrs;
6
6
use std::path::{Path,PathBuf};
7
7
use std::sync::Arc;
8
+
use std::time::Duration;
8
9
use stderrlog;
9
10
10
11
usecrate::chain::Network;
@@ -27,6 +28,7 @@ pub struct Config {
27
28
pubdaemon_rpc_addr:SocketAddr,
28
29
pubdaemon_rpc_fallback_addr:Option<SocketAddr>,
29
30
pubdaemon_parallelism:usize,
31
+
pubdaemon_conn_max_age:Option<Duration>,
30
32
pubcookie:Option<String>,
31
33
pubelectrum_rpc_addr:SocketAddr,
32
34
pubhttp_addr:SocketAddr,
@@ -177,6 +179,13 @@ impl Config {
177
179
.help("Number of JSONRPC requests to send in parallel")
178
180
.default_value("4")
179
181
)
182
+
.arg(
183
+
Arg::with_name("daemon_rpc_conn_max_age")
184
+
.long("daemon-rpc-conn-max-age")
185
+
.help("Max age (in seconds) of a daemon RPC TCP connection before it is proactively recycled. Recycling re-establishes the connection, letting a load balancer (e.g. a Kubernetes ClusterSetIP) re-select a backend after node rotations. The reconnect happens inline on the next request, so prefer a generous value (minutes, not seconds) to avoid periodic latency spikes. 0 = unlimited / never recycle (default)")
0 commit comments