From 743caff2f88f78dd8756e624b52d82ff9c29c4e0 Mon Sep 17 00:00:00 2001 From: wei <1415121722@qq.com> Date: Sun, 7 Sep 2025 11:33:40 +0800 Subject: [PATCH] update flashBlock keep-alive --- src/swqos/flashblock.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/swqos/flashblock.rs b/src/swqos/flashblock.rs index 7aee750..6fa7dca 100644 --- a/src/swqos/flashblock.rs +++ b/src/swqos/flashblock.rs @@ -47,9 +47,9 @@ impl FlashBlockClient { pub fn new(rpc_url: String, endpoint: String, auth_token: String) -> Self { let rpc_client = SolanaRpcClient::new(rpc_url); let http_client = Client::builder() - .pool_idle_timeout(Duration::from_secs(60)) + .pool_idle_timeout(Duration::from_secs(30)) .pool_max_idle_per_host(64) - .tcp_keepalive(Some(Duration::from_secs(1200))) + .tcp_keepalive(Some(Duration::from_secs(30))) .http2_keep_alive_interval(Duration::from_secs(15)) .timeout(Duration::from_secs(10)) .connect_timeout(Duration::from_secs(5)) @@ -75,6 +75,8 @@ impl FlashBlockClient { .body(request_body) .header("Authorization", &self.auth_token) .header("Content-Type", "application/json") + .header("Connection", "keep-alive") + .header("Keep-Alive", "timeout=30, max=1000") .send() .await? .text()