diff --git a/components/chainhook-sdk/src/chainhooks/bitcoin/mod.rs b/components/chainhook-sdk/src/chainhooks/bitcoin/mod.rs index 7d49ec127..633f310ad 100644 --- a/components/chainhook-sdk/src/chainhooks/bitcoin/mod.rs +++ b/components/chainhook-sdk/src/chainhooks/bitcoin/mod.rs @@ -21,7 +21,7 @@ use serde::{de, Deserialize, Deserializer}; use serde_json::Value as JsonValue; use std::{ collections::{BTreeMap, HashMap, HashSet}, - str::FromStr, + str::FromStr, time::Duration, }; use reqwest::RequestBuilder; @@ -766,6 +766,7 @@ pub fn handle_bitcoin_hook_action<'a>( match &trigger.chainhook.action { HookAction::HttpPost(http) => { let client = Client::builder() + .timeout(Duration::from_secs(30)) .build() .map_err(|e| format!("unable to build http client: {}", e.to_string()))?; let host = format!("{}", http.url); diff --git a/components/chainhook-sdk/src/chainhooks/stacks/mod.rs b/components/chainhook-sdk/src/chainhooks/stacks/mod.rs index 6bad60849..b3fe0334f 100644 --- a/components/chainhook-sdk/src/chainhooks/stacks/mod.rs +++ b/components/chainhook-sdk/src/chainhooks/stacks/mod.rs @@ -22,6 +22,7 @@ use schemars::JsonSchema; use serde_json::Value as JsonValue; use std::collections::{BTreeMap, HashMap}; use std::io::Cursor; +use std::time::Duration; use reqwest::RequestBuilder; @@ -1337,6 +1338,7 @@ pub fn handle_stacks_hook_action<'a>( match &trigger.chainhook.action { HookAction::HttpPost(http) => { let client = Client::builder() + .timeout(Duration::from_secs(30)) .build() .map_err(|e| format!("unable to build http client: {}", e.to_string()))?; let host = format!("{}", http.url);