Refine
This commit is contained in:
@@ -1801,6 +1801,11 @@ def query_all_record_by_date_property(query_date: str, type: str, property: str,
|
||||
raise ValueError(f"不支持的类型: {type}")
|
||||
# 将 start_date 的北京时间转换为 UTC 时间
|
||||
start_time = (datetime.strptime(query_date, "%Y-%m-%d") - timedelta(days=1)).replace(hour=16, minute=0, second=0, tzinfo=timezone.utc).isoformat()
|
||||
|
||||
print(str(start_time))
|
||||
|
||||
print("before query influxdb")
|
||||
|
||||
# 构建 Flux 查询语句
|
||||
flux_query = f'''
|
||||
from(bucket: "{bucket}")
|
||||
@@ -1811,6 +1816,9 @@ def query_all_record_by_date_property(query_date: str, type: str, property: str,
|
||||
'''
|
||||
# 执行查询
|
||||
tables = query_api.query(flux_query)
|
||||
|
||||
print("after query influxdb")
|
||||
|
||||
result_records = []
|
||||
# 解析查询结果
|
||||
for table in tables:
|
||||
|
||||
Reference in New Issue
Block a user