From 0c850e7ef2047e3785b5c2d4d78a0eec594f11b5 Mon Sep 17 00:00:00 2001 From: Alexander Hosking Date: Mon, 9 Jan 2023 00:34:25 -0500 Subject: [PATCH] Return influx data entry --- gmail/email_count.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gmail/email_count.py b/gmail/email_count.py index 91a02a5..d41773c 100644 --- a/gmail/email_count.py +++ b/gmail/email_count.py @@ -59,11 +59,11 @@ for account in accounts: date = strftime("%Y-%m-%d") time = strftime("%H:%M:%S") timestamp = date + "T" + time + "Z" - # write_api = client.write_api(write_options=SYNCHRONOUS) - # point = influxdb_client.Point("unread_emails").time(timestamp).tag("account", account)\ - # .field("count", unread_messages) - # write_api.write(bucket="personal_data", - # org=config['DB_ORG'], record=point) + write_api = client.write_api(write_options=SYNCHRONOUS) + point = influxdb_client.Point("unread_emails").time(timestamp).tag("account", account)\ + .field("count", unread_messages) + write_api.write(bucket="personal_data", + org=config['DB_ORG'], record=point) print(message) print(