图表 stats bar 温度数字 60 秒级轻量轮询
liveTemp state 独立于 hourly 缓存,每 60s fetch /api/city/{city}/summary。
只取 current.temp,不触发 _analyze() 重算。
图表曲线保持 5min TTL,顶部数字最快 1min 级更新。
This commit is contained in:
@@ -34,10 +34,13 @@ export function runTests() {
|
||||
);
|
||||
assert(
|
||||
chartSource.includes("DASHBOARD_REFRESH_POLICY_MS.metar") &&
|
||||
!chartSource.includes("setInterval(") &&
|
||||
!chartSource.includes("window.setInterval"),
|
||||
"selected city detail chart cache should align with 5-minute scan/metar cadence",
|
||||
);
|
||||
assert(
|
||||
chartSource.includes("setInterval(fetchLiveTemp, 60_000)"),
|
||||
"selected city chart should poll live temperature every 60 seconds via lightweight summary endpoint",
|
||||
);
|
||||
assert(
|
||||
chartSource.includes("_hourlyRequestCache") &&
|
||||
chartSource.includes("seedHourlyForecastFromRow") &&
|
||||
|
||||
Reference in New Issue
Block a user