🐛 Fix timezone not right in action log

This commit is contained in:
xtaodada 2024-06-18 13:19:24 +08:00
parent 87c22d56fb
commit 84ef241e16
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659

View File

@ -26,6 +26,8 @@ class ActionLogRepository(BaseService.Component):
client: "InfluxDBClientAsync" client: "InfluxDBClientAsync"
query = ( query = (
'import "date"' 'import "date"'
'import "timezone"'
'option location = timezone.location(name: "Asia/Shanghai")'
'from(bucket: "{}")' 'from(bucket: "{}")'
"|> range(start: -180d)" "|> range(start: -180d)"
'|> filter(fn: (r) => r["_measurement"] == "action_log")' '|> filter(fn: (r) => r["_measurement"] == "action_log")'