File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,7 @@ pub struct Config {
7878 pub logs_config_processing_rules : Option < Vec < ProcessingRule > > ,
7979 pub serverless_flush_strategy : FlushStrategy ,
8080 pub enhanced_metrics : bool ,
81+ pub flush_timeout : u64 ,
8182 pub https_proxy : Option < String > ,
8283 pub capture_lambda_payload : bool ,
8384 pub capture_lambda_payload_max_depth : u32 ,
@@ -102,6 +103,7 @@ impl Default for Config {
102103 api_key_secret_arn : String :: default ( ) ,
103104 kms_api_key : String :: default ( ) ,
104105 serverless_flush_strategy : FlushStrategy :: Default ,
106+ flush_timeout : 5 ,
105107 // Unified Tagging
106108 env : None ,
107109 service : None ,
Original file line number Diff line number Diff line change 11use crate :: config;
2+ use core:: time:: Duration ;
23use std:: sync:: Arc ;
34use tracing:: error;
45
@@ -16,7 +17,7 @@ pub fn get_client(config: Arc<config::Config>) -> reqwest::Client {
1617}
1718
1819fn build_client ( config : Arc < config:: Config > ) -> Result < reqwest:: Client , reqwest:: Error > {
19- let client = reqwest:: Client :: builder ( ) ;
20+ let client = reqwest:: Client :: builder ( ) . timeout ( Duration :: from_secs ( config . flush_timeout ) ) ;
2021 // This covers DD_PROXY_HTTPS and HTTPS_PROXY
2122 if let Some ( https_uri) = & config. https_proxy {
2223 let proxy = reqwest:: Proxy :: https ( https_uri. clone ( ) ) ?;
You can’t perform that action at this time.
0 commit comments