가사 품질 보강 — 한국어 수사 규칙·전체 분량·캐시 TTL

- 서수 고유어(4번째→네 번째), 고유어 조수사(방·개·명·골), 아웃 카운트
  영어 수사(2아웃→투아웃)
- 가사 축약 방지: 필수 섹션 명시(Verse2·Bridge·Final Chorus), max_tokens
  3000→8000, 450자 미만은 재시도
- 프론트 곡 캐시 하루→5분 TTL (당일 재생성 교체 반영)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
JinwooKimandClaude Fable 5 committed 2026-08-27 11:40:45 +09:00
1 parent cb00945612
commit 746eaced80
2 files changed
+29 -6

No files matched your search

+6 -2
View File
@@ -30,6 +30,9 @@ import { getTodaySongs, type SongOut } from "./api";
let songsPromise: Promise<SongOut[]> | null = null;
let songsDay = "";
let songsAt = 0;
// 곡은 라인업 반영 재생성으로 당일 중에도 교체되므로 짧은 TTL 로 재조회
const SONGS_TTL_MS = 5 * 60_000;
function todayKstKey(): string {
return new Date(Date.now() + 9 * 3600_000).toISOString().slice(0, 10);
@@ -37,9 +40,10 @@ function todayKstKey(): string {
function fetchSongsCached(): Promise<SongOut[]> {
const day = todayKstKey();
if (!songsPromise || songsDay !== day) {
if (!songsPromise || songsDay !== day || Date.now() - songsAt > SONGS_TTL_MS) {
songsDay = day;
songsPromise = getTodaySongs().catch(() => []); // 전 리그(kbo+mlb)
songsAt = Date.now();
songsPromise = getTodaySongs().catch(() => []); // 전 리그
}
return songsPromise;
}