adding node request timeout

This commit is contained in:
aglkm
2025-06-26 02:31:26 +03:00
parent f92825ee4d
commit 22bc39f69c

View File

@@ -32,6 +32,7 @@ pub async fn call(method: &str, params: &str, id: &str, rpc_type: &str) -> Resul
let client = reqwest::Client::new();
let result = client.post(rpc_url)
.timeout(Duration::from_secs(10))
.body(format!("{{\"method\": \"{}\", \"params\": {}, \"id\": {}, \"jsonrpc\": \"2.0\"}}", method, params, id))
.basic_auth(CONFIG.user.clone(), Some(secret))
.header("content-type", "application/json")
@@ -58,6 +59,7 @@ pub async fn call_external(method: &str, params: &str, id: &str, rpc_type: &str,
let client = reqwest::Client::new();
let result = client.post(rpc_url)
.timeout(Duration::from_secs(10))
.body(format!("{{\"method\": \"{}\", \"params\": {}, \"id\": {}, \"jsonrpc\": \"2.0\"}}", method, params, id))
.header("content-type", "application/json")
.send()