pub mod api_routes_http;
-pub mod api_routes_websocket;
pub mod code_migrations;
pub mod root_span_builder;
pub mod scheduled_tasks;
};
use reqwest::Client;
use reqwest_middleware::ClientBuilder;
-use reqwest_retry::{policies::ExponentialBackoff, RetryTransientMiddleware};
use reqwest_tracing::TracingMiddleware;
use std::{env, thread, time::Duration};
use tracing::subscriber::set_global_default;
let reqwest_client = Client::builder()
.user_agent(user_agent.clone())
.timeout(REQWEST_TIMEOUT)
+ .connect_timeout(REQWEST_TIMEOUT)
.build()?;
- let retry_policy = ExponentialBackoff {
- max_n_retries: 3,
- max_retry_interval: REQWEST_TIMEOUT,
- min_retry_interval: Duration::from_millis(100),
- backoff_exponent: 2,
- };
-
let client = ClientBuilder::new(reqwest_client.clone())
.with(TracingMiddleware::default())
- .with(RetryTransientMiddleware::new_with_policy(retry_policy))
.build();
// Pictrs cannot use the retry middleware