Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

import java.time.Duration;
Expand All @@ -26,6 +27,15 @@ public class PromotionRecheckService {
@Value("${toss.api.promotion.code}")
private String promotionCode;

@Value("${toss.api.promotion.recheck.scheduler.limit}")
private int schedulerLimit;

@Scheduled(fixedDelayString = "${toss.api.promotion.recheck.scheduler.delay-ms}")
public void scheduledRecheckPending() {
log.info("[PROMO-SCHEDULER] 스케줄러 실행");
recheckPending(schedulerLimit);
}

public PromotionRecheckPendingResponse recheckPending(int limit) {
List<PromotionGrant> pendings = promotionGrantRepository.findPendingWithExecKey(limit);

Expand Down
Loading