fix: 修复客退看板缓存命中时引用未定义常量导致 500
缓存 TTL 改成可配(DEFAULT_CACHE_TTL_MS / resolveCacheTtlMs)时漏改了 loadReplicaRows 里的比较表达式,仍写 CACHE_TTL_MS。缓存为空时短路不触发, 所以本地首轮没暴露;生产被预热任务写过缓存后,第二次请求命中该行即 ReferenceError 500。改为调用 resolveCacheTtlMs()。
This commit is contained in:
parent
6c3b14fc10
commit
f7fc7fef4f
@ -420,7 +420,7 @@ async function loadReplicaRows({
|
|||||||
const basis = resolveCreatedAtBasis(createdAtBasis);
|
const basis = resolveCreatedAtBasis(createdAtBasis);
|
||||||
const key = buildCacheKey(warehouse, basis);
|
const key = buildCacheKey(warehouse, basis);
|
||||||
const cached = rowCache.get(key);
|
const cached = rowCache.get(key);
|
||||||
if (!refresh && cached && cached.rows && Date.now() - cached.at < CACHE_TTL_MS) {
|
if (!refresh && cached && cached.rows && Date.now() - cached.at < resolveCacheTtlMs()) {
|
||||||
return cached.rows;
|
return cached.rows;
|
||||||
}
|
}
|
||||||
const running = inflightCache.get(key);
|
const running = inflightCache.get(key);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user