[FIX] Upstash 유휴 자동 삭제 방지 — /health/redis + 주간 keepalive cron (#527) - #528
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
✨ 변경 사항
src/index.ts—/health/redis라우트 추가.redisClient.ping()을 2s 타임아웃으로 감싸 hang 방지. 성공 200 / 실패 503..github/workflows/redis-keepalive.yml— 매주 월 03:00 UTC (12:00 KST) 에 dev + prod 양쪽/health/redis로curl -fsS.workflow_dispatch로 수동 실행도 가능.✨ 원인
Upstash free tier 의 비활성 DB 자동 삭제 정책. Redis command 가 며칠간 없으면 삭제 대상. visitor middleware 는
BOT_UA_PATTERN으로 uptime monitor / curl UA 를 걸러내서 health check 나 크롤러 트래픽이 있어도 Redis 명령으로 이어지지 않음. 실 유저 트래픽이 조용한 시기엔 Upstash 가 진짜로 비활성 →unique-snail처럼 소멸.✨ 왜 이 형태인가
SKIP_PATH_PREFIXES가 이미/healthprefix 를 스킵하니 방문자 카운트 오염 없음.✨ 검증
pnpm build통과.curl -i https://promptplace-dev.kro.kr/health/redis/https://promptplace.kro.kr/health/redis→ Redis 정상이면200 PONG, 죽으면503 REDIS_UNAVAILABLE.redis-keepalive→Run workflow로 수동 실행 즉시 검증 가능.✨ 기타
Closes #527