feat: 429 응답 시 API 키 쿨다운 적용 - #7
Merged
Merged
Conversation
- KeyPool에 키별 쿨다운 상태(cooldown_until) 추가 - 429 응답 시 Retry-After 헤더 파싱하여 쿨다운 설정 - Retry-After 헤더 없으면 기본 60초 쿨다운 적용 - acquire/acquire_excluding에서 쿨다운 중인 키 자동 건너뜀 - 쿨다운 진입 시 WARN 레벨 로깅 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
Retry-After헤더를 존중하여 쿨다운 시간 결정Changes
KeyPool에 키별 쿨다운 만료 시각(cooldown_until: AtomicU64) 추가parse_retry_after()함수로 응답에서 쿨다운 시간 파싱set_cooldown()메서드로 429 받은 키에 쿨다운 설정acquire()/acquire_excluding()에서 쿨다운 중인 키 자동 제외Test plan
cargo test- 41개 테스트 통과 (기존 37 + 신규 4)cargo build --release- 빌드 성공🤖 Generated with Claude Code