260715_01_ENH: 스케쥴러에 들어가는 설정들 yml로 이동

This commit is contained in:
2026-07-15 08:22:35 +09:00
parent e38a095755
commit 132a8a0367
4 changed files with 22 additions and 6 deletions

View File

@@ -23,6 +23,7 @@ import java.util.Set;
import java.util.function.Function;
import java.util.stream.Collectors;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.PageRequest;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
@@ -37,16 +38,22 @@ public class BizLogResultScheduler {
private final BizLogRepository bizLogRepository;
private final BulkSendRepository bulkSendRepository;
@Scheduled(fixedDelay = 60 * 1_000) // 나중에 증가시킬 것
@Value("${kri.sms.result-sync.window-hours:1}")
private long resultSyncWindowHours;
@Value("${kri.sms.result-sync.batch-size:1000}")
private int resultSyncBatchSize;
@Scheduled(fixedDelayString = "${kri.sms.result-sync.fixed-delay-ms:60000}") // 나중에 증가시킬 것
@Transactional(transactionManager = "transactionManager")
public void syncSmsResults() {
TimeWindow window = buildWindow(1L); // hours는 추후 파라미터화
TimeWindow window = buildWindow(resultSyncWindowHours);
List<Short> sendTyList = List.of(SendType.SMS.getCode(), SendType.LMS_MMS.getCode(), SendType.KKO_AT.getCode());
while (true) {
List<TSendEntity> batch = fetchRefreshTargets(sendTyList, window, 1000);
List<TSendEntity> batch = fetchRefreshTargets(sendTyList, window, resultSyncBatchSize);
if (batch.isEmpty()) {
return;
}

View File

@@ -11,7 +11,7 @@ public class EmailResultPollScheduler {
private final EmailResultPoller emailResultPoller;
@Scheduled(cron = "0 */5 * * * *")
@Scheduled(cron = "${kri.email.result-poll.recover-cron:0 */5 * * * *}")
public void enqueueRecoverableEmailResults() {
emailResultPoller.enqueueRecoverableEmailResults();
}

View File

@@ -27,7 +27,7 @@ public class SendReservationEmailScheduler {
private final SendEmailService sendEmlService;
private final SendRepository sendRepository;
@Scheduled(cron = "0 */5 * * * *")
@Scheduled(cron = "${kri.email.reservation-send.cron:0 */5 * * * *}")
@Transactional(transactionManager = "transactionManager")
public void sendReservationEmail() {
LocalDateTime now = DateTimeUtil.nowKstLocalDateTime();