diff --git a/influxdb_api.py b/influxdb_api.py index ea89b85..cf7b924 100644 --- a/influxdb_api.py +++ b/influxdb_api.py @@ -1814,8 +1814,8 @@ def store_realtime_simulation_result_to_influxdb(node_result_list: List[Dict[str write_api.write(bucket=bucket, org=org_name, record=points_to_write) write_api.flush() # 刷新缓存一次 except Exception as e: + client.close() raise RuntimeError(f"数据写入 InfluxDB 时发生错误: {e}") - client.close() time.sleep(10) print("Total points written:", points_written)