更新数据导入方法,copy语法改为insert语法以支持冲突时数据覆盖
This commit is contained in:
@@ -28,12 +28,9 @@ class InternalStorage:
|
||||
else timescaledb_info.get_pgconn_string()
|
||||
)
|
||||
with psycopg.Connection.connect(conn_string) as conn:
|
||||
starttime = time.time()
|
||||
RealtimeRepository.store_realtime_simulation_result_sync(
|
||||
conn, node_result_list, link_result_list, result_start_time
|
||||
)
|
||||
endtime = time.time()
|
||||
logger.info(f"存储实时模拟结果耗时: {endtime - starttime} 秒")
|
||||
break # 成功
|
||||
except Exception as e:
|
||||
logger.error(f"存储尝试 {attempt + 1} 失败: {e}")
|
||||
|
||||
Reference in New Issue
Block a user