Skip to main content

futu_backend/
reference_http.rs

1//! Shared HTTP client for reference-data background downloads.
2
3use std::time::Duration;
4
5/// Timeout for best-effort CDN reference-data downloads.
6pub const REFERENCE_DATA_HTTP_TIMEOUT: Duration = Duration::from_secs(10);
7
8/// Build a reusable client for suspend/code-change reference-data downloads.
9pub fn build_client() -> Result<reqwest::Client, reqwest::Error> {
10    reqwest::Client::builder()
11        .timeout(REFERENCE_DATA_HTTP_TIMEOUT)
12        .build()
13}
14
15#[cfg(test)]
16mod tests;