新增同步存储方法;新增run_server.py文件;修改默认的数据库连接方式;
This commit is contained in:
@@ -21,7 +21,6 @@ import globals
|
||||
import uuid
|
||||
import project_info
|
||||
from api.postgresql_info import get_pgconn_string
|
||||
import asyncio
|
||||
from timescaledb.internal_queries import InternalStorage as TimescaleInternalStorage
|
||||
|
||||
logging.basicConfig(
|
||||
@@ -1231,24 +1230,20 @@ def run_simulation(
|
||||
# print(node_result)
|
||||
# 存储
|
||||
if simulation_type.upper() == "REALTIME":
|
||||
asyncio.run(
|
||||
TimescaleInternalStorage.store_realtime_simulation(
|
||||
node_result, link_result, modify_pattern_start_time
|
||||
)
|
||||
TimescaleInternalStorage.store_realtime_simulation(
|
||||
node_result, link_result, modify_pattern_start_time
|
||||
)
|
||||
elif simulation_type.upper() == "EXTENDED":
|
||||
asyncio.run(
|
||||
TimescaleInternalStorage.store_scheme_simulation(
|
||||
scheme_Type,
|
||||
scheme_Name,
|
||||
node_result,
|
||||
link_result,
|
||||
modify_pattern_start_time,
|
||||
num_periods_result,
|
||||
)
|
||||
TimescaleInternalStorage.store_scheme_simulation(
|
||||
scheme_Type,
|
||||
scheme_Name,
|
||||
node_result,
|
||||
link_result,
|
||||
modify_pattern_start_time,
|
||||
num_periods_result,
|
||||
)
|
||||
# 暂不需要再次存储 SCADA 模拟信息
|
||||
# TimescaleInternalStorage.fill_scheme_simulation_result_to_SCADA(scheme_Type=scheme_Type, scheme_Name=scheme_Name)
|
||||
# 暂不需要再次存储 SCADA 模拟信息
|
||||
# TimescaleInternalStorage.fill_scheme_simulation_result_to_SCADA(scheme_Type=scheme_Type, scheme_Name=scheme_Name)
|
||||
|
||||
# if simulation_type.upper() == "REALTIME":
|
||||
# influxdb_api.store_realtime_simulation_result_to_influxdb(
|
||||
|
||||
Reference in New Issue
Block a user