Server tools to backfill, tail, mirror, and verify PLC logs
at debug 23 lines 711 B view raw
1use reqwest::Client; 2use reqwest_middleware::{ClientBuilder, ClientWithMiddleware}; 3use reqwest_retry::{RetryTransientMiddleware, policies::ExponentialBackoff}; 4use std::sync::LazyLock; 5 6pub const UA: &str = concat!( 7 "allegedly, v", 8 env!("CARGO_PKG_VERSION"), 9 " (from @microcosm.blue; contact @bad-example.com)" 10); 11 12pub static CLIENT: LazyLock<ClientWithMiddleware> = LazyLock::new(|| { 13 let inner = Client::builder() 14 .user_agent(UA) 15 .build() 16 .expect("reqwest client to build"); 17 18 let policy = ExponentialBackoff::builder().build_with_max_retries(12); 19 20 ClientBuilder::new(inner) 21 .with(RetryTransientMiddleware::new_with_policy(policy)) 22 .build() 23});