Skip to content

✨ OMF-146 프로모션 PENDING 상태 재조회#106

Merged
KJaeKwan merged 2 commits intodevelopfrom
OMF-146
Feb 14, 2026
Merged

✨ OMF-146 프로모션 PENDING 상태 재조회#106
KJaeKwan merged 2 commits intodevelopfrom
OMF-146

Conversation

@KJaeKwan
Copy link
Collaborator

@KJaeKwan KJaeKwan commented Feb 8, 2026

✨ Related Issue


📌 Task Details

  • 수동으로 호출하던 promotion 상태 recheck API에 스케줄러 설정

💬 Review Requirements (Optional)

  • 스케줄러 호출하는 설정 yml에 추가해뒀습니다
  • 10분에 10회씩 조회하도록 해뒀는데, 상황에 따라 조정하면 될듯 해요

Summary by CodeRabbit

새로운 기능

  • 프로모션 재확인 기능의 정기적 자동 실행 스케줄링이 추가되었습니다.
  • 설정을 통해 재확인 주기 및 처리 건수 한도를 제어할 수 있습니다.

@KJaeKwan KJaeKwan self-assigned this Feb 8, 2026
@KJaeKwan KJaeKwan added the 🌟feature 새로운 기능 label Feb 8, 2026
@coderabbitai
Copy link

coderabbitai bot commented Feb 8, 2026

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review

Note

.coderabbit.yml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized key(s) in object: 'tools'
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
📝 Walkthrough

Walkthrough

PromotionRecheckService에 Spring의 @Scheduled를 통한 정기적 실행 기능을 추가했습니다. 설정에서 로드되는 schedulerLimit 속성과 함께 새로운 scheduledRecheckPending() 메서드를 도입하여, 기존 온디맨드 recheckPending(int) 흐름에 더해 주기적인 재검사를 가능하게 했습니다.

Changes

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

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Collaborator

@wonjuneee wonjuneee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

현재 단계에선 스케줄러로 충분한 것 같네요

LGTM

@KJaeKwan KJaeKwan merged commit abc9d84 into develop Feb 14, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🌟feature 새로운 기능

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants