From 045302465be823e1966ddefd7116bd1265b5f434 Mon Sep 17 00:00:00 2001 From: Jonathan Strong Date: Fri, 7 Dec 2018 07:05:02 -0500 Subject: [PATCH] InfluxWriter::placeholder() -> no thread for tests, etc --- src/influx.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/influx.rs b/src/influx.rs index 254ee8f..754c0dc 100644 --- a/src/influx.rs +++ b/src/influx.rs @@ -278,6 +278,16 @@ impl InfluxWriter { self.tx.clone() } + pub fn placeholder() -> Self { + let (tx, _) = channel(); + Self { + host: String::new(), + db: String::new(), + tx, + thread: None, + } + } + pub fn new(host: &str, db: &str, log_path: &str, buffer_size: u16) -> Self { let logger = file_logger(log_path, LOG_LEVEL); // this needs to be outside the thread Self::with_logger(host, db, buffer_size, logger)