From 1da2c1ab09889a6b3351b2f128f47f7bffcecbdc Mon Sep 17 00:00:00 2001 From: Jonathan Strong Date: Thu, 16 Jan 2020 12:12:55 -0500 Subject: [PATCH] fix minor blemishes --- src/influx.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/influx.rs b/src/influx.rs index b95fdac..045cd32 100644 --- a/src/influx.rs +++ b/src/influx.rs @@ -97,7 +97,7 @@ impl AsF64 for f32 { fn as_f64(x: Self) -> f64 { x as f64 } } /// use logging::influx::*; /// /// fn main() { -/// let (tx, rx) = bounded(1024); +/// let (tx, rx) = crossbeam_channel::bounded(1024); /// /// // "shorthand" syntax /// @@ -359,7 +359,6 @@ impl InfluxWriter { &[("db", db), ("precision", "ns")]) .expect("influx writer url should parse"); let thread = thread::Builder::new().name(format!("mm:inflx:{}", db)).spawn(move || { - use std::collections::VecDeque; use std::time::*; use crossbeam_channel as chan; @@ -441,7 +440,7 @@ impl InfluxWriter { let logger = thread_logger; debug!(logger, "preparing to send http request to influx"; "buf.len()" => buf.len()); let start = Instant::now(); - 'a: for n_req in 0..N_HTTP_ATTEMPTS { + for n_req in 0..N_HTTP_ATTEMPTS { let throttle = Duration::from_secs(2) * n_req * n_req; if n_req > 0 { warn!(logger, "InfluxWriter http thread: pausing before next request"; @@ -462,7 +461,7 @@ impl InfluxWriter { debug!(logger, "server responded ok: 204 NoContent"); buf.clear(); let mut resp = Some(Ok(Resp { buf, took })); - 'b: loop { + loop { n_tx += 1; match tx.try_send(resp.take().unwrap()) { Ok(_) => {