Refine
This commit is contained in:
@@ -2135,16 +2135,16 @@ if __name__ == "__main__":
|
||||
token = influxdb_info.token
|
||||
org_name = influxdb_info.org
|
||||
|
||||
# client = InfluxDBClient(url=url, token=token)
|
||||
client = InfluxDBClient(url=url, token=token)
|
||||
|
||||
# step1: 检查连接状态,初始化influxdb的buckets
|
||||
# try:
|
||||
# # delete_buckets(client, org_name)
|
||||
# create_and_initialize_buckets(client, org_name)
|
||||
# except Exception as e:
|
||||
# print(f"连接失败: {e}")
|
||||
# finally:
|
||||
# client.close()
|
||||
try:
|
||||
delete_buckets(client, org_name)
|
||||
create_and_initialize_buckets(client, org_name)
|
||||
except Exception as e:
|
||||
print(f"连接失败: {e}")
|
||||
finally:
|
||||
client.close()
|
||||
|
||||
# step2: 先查询pg数据库中scada_info的信息,然后存储SCADA数据到SCADA_data这个bucket里
|
||||
# query_pg_scada_info_realtime('bb')
|
||||
|
||||
@@ -8,3 +8,6 @@ Setup instructions for WMH's work
|
||||
Should manullay change code
|
||||
|
||||
3. run create_template.py
|
||||
|
||||
4. run influxdb_api.py
|
||||
create buckets
|
||||
Reference in New Issue
Block a user