[배치] dev 환경에서만 배치 돌도록 수정 + 스케줄 시간 원복

This commit is contained in:
kangsunlee
2025-07-22 09:26:19 +09:00
parent 786024e70d
commit 74bc470823

View File

@@ -35,16 +35,20 @@ public class AutoSchedulesController {
* 월별입력상태 등록
* 매 월 1일 0초 마다 실행되는 스케줄러
*/
//@Scheduled(cron = "0 0 0 1 * *")
@Scheduled(cron = "0 0 * * * *")
@Scheduled(cron = "0 0 0 1 * *")
public void fetchMonthlyStatus() {
if ("dev".equals(activeProfiles)) {
log.info("fetchMonthlyStatus 는 dev 환경에서만 실행됩니다. (현재: {})", activeProfiles);
return;
}
String lockKey = "fetchMonthlyStatus_" + java.time.LocalDate.now();
try {
String host = java.net.InetAddress.getLocalHost().getHostName();
// 중복 실행 방지를 위한 간단한 체크
if (isAlreadyRunning(lockKey)) {
log.warn("fetchMonthlyStatus가 이미 실행 중입니다. 중복 실행을 건너뜁니다.");
log.warn("fetchMonthlyStatus 가 이미 실행 중입니다. 중복 실행을 건너뜁니다.");
batchLogPortIn.createError(BatchLogType.MONTHLY_STATUS, host, "WARNING", "fetchMonthlyStatus가 이미 실행 중입니다. 중복 실행을 건너뜁니다.");
return;
@@ -70,7 +74,7 @@ public class AutoSchedulesController {
@Scheduled(cron = "0 0 17 * * ?")
public void fetchSmsAutoSend() {
if ("dev".equals(activeProfiles)) {
log.info("fetchSmsAutoSend는 dev 환경에서만 실행됩니다. (현재: {})", activeProfiles);
log.info("fetchSmsAutoSend 는 dev 환경에서만 실행됩니다. (현재: {})", activeProfiles);
return;
}
@@ -106,9 +110,13 @@ public class AutoSchedulesController {
* 월초이월금 계산하여 등록
* 매월 16일 0시 0초에 실행되는 스케줄러
*/
// @Scheduled(cron = "0 0 0 16 * *")
@Scheduled(cron = "0 0 * * * *")
@Scheduled(cron = "0 0 0 16 * *")
public void fetchMonthlyCarryOver() {
if ("dev".equals(activeProfiles)) {
log.info("fetchMonthlyCarryOver 는 dev 환경에서만 실행됩니다. (현재: {})", activeProfiles);
return;
}
String lockKey = "fetchMonthlyCarryOver_" + java.time.LocalDate.now();
try {
String host = java.net.InetAddress.getLocalHost().getHostName();