From fa7767d1721d59cacb5cd3594a36f3213290e747 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9C=A4=EC=A0=95=EB=AF=BC?= Date: Thu, 28 May 2026 17:32:40 +0900 Subject: [PATCH] Stop bulk-invalidating game_detail cache in kboRefresh (W6) The 02:00 cron prefix-deleted all game_detail__ docs, but those already carry a response-derived dynamic TTL (7d for finished games, 30s live, etc.). Bulk-wiping them forces a cold-miss stampede of external KBO detail re-fetches right after the cron. Drop the deletion and let each key expire on its own TTL. rank__ and schedule_day__ still get the safety-net invalidation. --- src/scheduled/kboRefresh.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/scheduled/kboRefresh.ts b/src/scheduled/kboRefresh.ts index 6fdaa3c..1b9a220 100644 --- a/src/scheduled/kboRefresh.ts +++ b/src/scheduled/kboRefresh.ts @@ -35,7 +35,9 @@ export const kboDailyRefresh = onSchedule( await invalidateByPrefix("rank__"); await invalidateByPrefix("schedule_day__"); - await invalidateByPrefix("game_detail__"); + // game_detail__는 응답 기반 동적 TTL(종료 경기 7d, 라이브 30s 등)을 이미 갖고 있어 + // 02:00 일괄 무효화 대상에서 제외한다. 일괄 삭제 시 직후 상세 조회가 한꺼번에 미스나 + // 외부 재조회 폭주를 유발하므로, TTL 자연 만료에 위임한다. try { await fetchRankFromKbo([year]);