Update write option
This commit is contained in:
@@ -185,6 +185,7 @@ def create_write_options() -> WriteOptions:
|
||||
return WriteOptions(
|
||||
jitter_interval=200, # 添加抖动以避免同时写入
|
||||
max_retry_delay=30000, # 最大重试延迟(毫秒)
|
||||
max_retries=5, # 最大重试次数(0 表示不重试)
|
||||
batch_size=10_000, # 每批次发送10,000个点
|
||||
flush_interval=10_000, # 10秒强制刷新
|
||||
retry_interval=5_000 # 失败重试间隔5秒
|
||||
@@ -400,7 +401,7 @@ def store_realtime_SCADA_data_to_influxdb(get_real_value_time: str, bucket: str
|
||||
|
||||
# 使用异步写入模式配置写入选项和回调函数
|
||||
write_api = client.write_api(
|
||||
write_options= create_write_options(),
|
||||
write_options=create_write_options(),
|
||||
success_callback=success_callback,
|
||||
error_callback=error_callback
|
||||
)
|
||||
@@ -3552,7 +3553,7 @@ if __name__ == "__main__":
|
||||
# node_id = "ZBBDTZDP000022" # 查询的节点 ID
|
||||
# link_id = "ZBBGXSZW000002"
|
||||
#
|
||||
# latest_record = query_latest_record_by_ID(ID=node_id, type="node", bucket=bucket_name)
|
||||
# latest_record = query_latest_record_by_ID(ID=node_id, type="node", bucket=bucket_name)uodao
|
||||
# # # latest_record = query_latest_record_by_ID(ID=link_id, type="link", bucket=bucket_name)
|
||||
# #
|
||||
# if latest_record:
|
||||
|
||||
Reference in New Issue
Block a user