Mysql related functionality finished
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
import asyncio
|
||||
|
||||
from influxdb_client.client.influxdb_client_async import InfluxDBClientAsync
|
||||
from config import INFLUX_BUCKET, INFLUX_ORG
|
||||
from sqlalchemy.ext.asyncio import AsyncSession, async_sessionmaker
|
||||
|
||||
from influx_related import get_influx_data
|
||||
from models.execution.model_execution import ExecutionModel
|
||||
from utils.db.db_execution import ExecutionQueryAsync
|
||||
|
||||
|
||||
async def internal_loop(influxdb_client: InfluxDBClientAsync):
|
||||
async def internal_loop(influxdb_client: InfluxDBClientAsync, mysql_client: AsyncSession):
|
||||
i = 0
|
||||
while True:
|
||||
print("internal_loop", i)
|
||||
@@ -16,4 +19,11 @@ async def internal_loop(influxdb_client: InfluxDBClientAsync):
|
||||
[print(" -", i) for i in records]
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
print(f"{type(mysql_client)=}")
|
||||
# print(f"{type(mysql_client())=}")
|
||||
execution_query = ExecutionQueryAsync(mysql_client)
|
||||
execution_model: list[ExecutionModel] = await execution_query.get_execution_by_id(293)
|
||||
res = [i.asdict() for i in execution_model]
|
||||
print(res[0]['id'])
|
||||
await asyncio.sleep(5)
|
||||
|
||||
Reference in New Issue
Block a user