图表 stats bar 温度数字 60 秒级轻量轮询

liveTemp state 独立于 hourly 缓存,每 60s fetch /api/city/{city}/summary。
只取 current.temp,不触发 _analyze() 重算。
图表曲线保持 5min TTL,顶部数字最快 1min 级更新。
This commit is contained in:
2569718930@qq.com
2026-05-26 08:30:33 +08:00
parent 5b19a49ffb
commit 23203f6ebb
2 changed files with 26 additions and 3 deletions
@@ -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") &&