Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
Note
|
| Cohort / File(s) | Summary |
|---|---|
Scheduling Addition src/main/java/OneQ/OnSurvey/global/promotion/application/PromotionRecheckService.java |
schedulerLimit 필드와 @Scheduled 어노테이션이 적용된 scheduledRecheckPending() 메서드 추가. 설정에서 고정 지연 시간을 로드하여 정기적으로 recheckPending()을 호출합니다. |
Estimated code review effort
🎯 1 (Trivial) | ⏱️ ~3 minutes
Possibly related PRs
- ✨ OMF-66 프로모션 지급 결과 재조회하는 임시 컨트롤러 추가 #83: PromotionRecheckService와 recheckPending(int) 기본 로직을 최초 추가한 PR로, 본 PR에서 스케줄링 기능으로 확장되었습니다.
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Docstring Coverage | Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. | Write docstrings for the functions missing them to satisfy the coverage threshold. |
✅ Passed checks (2 passed)
| Check name | Status | Explanation |
|---|---|---|
| Title check | ✅ Passed | PR 제목이 변경 사항의 핵심을 명확하게 설명합니다. 프로모션 PENDING 상태 재조회 스케줄러 추가라는 주요 변경 내용을 잘 반영하고 있습니다. |
| Description check | ✅ Passed | PR 설명이 제공된 템플릿을 따르고 있으며, 관련 이슈, 작업 내용, 검토 사항이 모두 포함되어 있습니다. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing touches
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Post copyable unit tests in a comment
- Commit unit tests in branch
OMF-146
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In
`@src/main/java/OneQ/OnSurvey/global/promotion/application/PromotionRecheckService.java`:
- Around line 30-31: The field schedulerLimit in PromotionRecheckService is
annotated with `@Value`("${toss.api.promotion.recheck.scheduler.limit}") and has
no default, causing app startup failure if the property is missing; fix by
providing a safe default in the `@Value` expression (e.g.
`@Value`("${toss.api.promotion.recheck.scheduler.limit:10}") ) or switch to a
nullable/boxed type with fallback logic in PromotionRecheckService
constructor/init so the service uses a sensible default when the property is
absent.
- Around line 33-37: The scheduledRecheckPending method currently calls
recheckPending(schedulerLimit) without protecting against runtime exceptions
from calls like promotionGrantRepository.findPendingWithExecKey(limit); wrap the
body of scheduledRecheckPending in a try-catch that catches Exception (or
Throwable if desired), log the error with the "[PROMO-SCHEDULER]" context and
the exception (e.g., log.error("[PROMO-SCHEDULER] scheduledRecheckPending
failed", ex)), and ensure the catch does not rethrow so the scheduler invocation
is properly logged and the thread remains stable; keep the call to
recheckPending(schedulerLimit) inside the try block.
src/main/java/OneQ/OnSurvey/global/promotion/application/PromotionRecheckService.java
Show resolved
Hide resolved
src/main/java/OneQ/OnSurvey/global/promotion/application/PromotionRecheckService.java
Show resolved
Hide resolved
wonjuneee
left a comment
There was a problem hiding this comment.
현재 단계에선 스케줄러로 충분한 것 같네요
LGTM
✨ Related Issue
📌 Task Details
💬 Review Requirements (Optional)
Summary by CodeRabbit
새로운 기능