Return influx data entry

This commit is contained in:
Alexander Hosking 2023-01-09 00:34:25 -05:00
parent b202889766
commit 0c850e7ef2

View File

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