Influx related functionality finished
This commit is contained in:
19
internal_loop.py
Normal file
19
internal_loop.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import asyncio
|
||||
|
||||
from influxdb_client.client.influxdb_client_async import InfluxDBClientAsync
|
||||
from config import INFLUX_BUCKET, INFLUX_ORG
|
||||
from influx_related import get_influx_data
|
||||
|
||||
|
||||
async def internal_loop(influxdb_client: InfluxDBClientAsync):
|
||||
i = 0
|
||||
while True:
|
||||
print("internal_loop", i)
|
||||
i += 1
|
||||
try:
|
||||
records = await get_influx_data(influxdb_client)
|
||||
print("influx records:", len(records))
|
||||
[print(" -", i) for i in records]
|
||||
except Exception as e:
|
||||
print(e)
|
||||
await asyncio.sleep(5)
|
||||
Reference in New Issue
Block a user