High-performance implementation of plcbundle written in Rust

refactor(shutdown): simplify shutdown condition checks

+5 -9
+2 -4
src/manager.rs
··· 1873 1873 } 1874 1874 1875 1875 let fetch_op_start = Instant::now(); 1876 - if let Some(ref rx) = shutdown_rx { 1877 - if *rx.borrow() { 1878 - anyhow::bail!("Shutdown requested"); 1879 - } 1876 + if let Some(ref rx) = shutdown_rx && *rx.borrow() { 1877 + anyhow::bail!("Shutdown requested"); 1880 1878 } 1881 1879 let (plc_ops, wait_dur, http_dur) = if let Some(rx) = shutdown_rx.clone() { 1882 1880 client
+2 -4
src/plc_client.rs
··· 98 98 let mut total_http = Duration::from_secs(0); 99 99 100 100 for attempt in 1..=max_retries { 101 - if let Some(ref rx) = shutdown_rx { 102 - if *rx.borrow() { 103 - anyhow::bail!("Shutdown requested"); 104 - } 101 + if let Some(ref rx) = shutdown_rx && *rx.borrow() { 102 + anyhow::bail!("Shutdown requested"); 105 103 } 106 104 let export_url = format!( 107 105 "{}/export?after={}&count={}",
+1 -1
src/sync.rs
··· 270 270 bundle_num: u32, 271 271 hash: &str, 272 272 age: &str, 273 - fetch_duration_ms: u64, 273 + _fetch_duration_ms: u64, 274 274 bundle_save_ms: u64, 275 275 index_ms: u64, 276 276 _total_duration_ms: u64,