use once_cell::sync::Lazy;
use reqwest::Client;
use std::time::Duration;
use crate::env::request_timeout_secs;
#[allow(
clippy::expect_used,
reason = "reqwest ClientBuilder with default params cannot fail"
)]
static HTTP: Lazy<Client> = Lazy::new(|| {
Client::builder()
.timeout(Duration::from_secs(request_timeout_secs()))
.pool_max_idle_per_host(2)
.user_agent(concat!(
"cognee-rust/",
env!("CARGO_PKG_VERSION"),
" (send_telemetry)"
))
.build()
.expect("reqwest client builder cannot fail with default params")
});
pub fn client() -> &'static Client {
&HTTP
}