mirror of
https://github.com/simon987/chan_feed.git
synced 2025-04-19 10:16:41 +00:00
19 lines
388 B
Python
19 lines
388 B
Python
from influxdb import InfluxDBClient
|
|
|
|
client = InfluxDBClient("localhost", 8086, "root", "root", "chan_feed")
|
|
|
|
|
|
def init():
|
|
db_exists = False
|
|
for db in client.get_list_database():
|
|
if db["name"] == "chan_feed":
|
|
db_exists = True
|
|
break
|
|
|
|
if not db_exists:
|
|
client.create_database("chan_feed")
|
|
|
|
|
|
def log(event):
|
|
client.write_points(event)
|