From c474999f6a26d397bded589f038b0a613fe15a18 Mon Sep 17 00:00:00 2001 From: "Brian J. Tarricone" Date: Wed, 15 Jun 2022 17:00:34 -0700 Subject: [PATCH] Use nanosecond timestamps --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 0283b5d..84256b7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -145,11 +145,11 @@ async fn handle_publish( let timestamp = timestamp.unwrap_or_else(|| SystemTime::now() .duration_since(UNIX_EPOCH) .unwrap() - .as_millis() + .as_nanos() ); for database in databases.iter() { - let mut query = Timestamp::Milliseconds(timestamp) + let mut query = Timestamp::Nanoseconds(timestamp) .into_query(&database.measurement) .add_field(&field_name, influx_value.clone()); for tag in mapping.tags.iter() {