Browse Source

InfluxWriter::placeholder() -> no thread for tests, etc

master
Jonathan Strong 5 years ago
parent
commit
045302465b
1 changed files with 10 additions and 0 deletions
  1. +10
    -0
      src/influx.rs

+ 10
- 0
src/influx.rs View File

@@ -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)


Loading…
Cancel
Save