Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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 @@ -17,21 +17,21 @@ public class AlarmSchedulerService {

// 기존 설정 시각
//@Scheduled(cron = "0 0 13 * * *", zone = "Asia/Seoul")
@Scheduled(cron = "0 0 14 * * *", zone = "Asia/Seoul")
@Scheduled(cron = "0 8 15 * * *", zone = "Asia/Seoul")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

스케줄러의 cron 표현식이 소스 코드에 하드코딩되어 있습니다. 시연 및 테스트 환경이나 운영 환경에 따라 스케줄러 주기를 유연하게 변경할 수 있도록, Spring의 프로퍼티 플레이스홀더(${...})를 사용하여 외부 설정 파일(application.yml 등)에서 관리할 수 있도록 개선하는 것을 권장합니다. 기본값을 지정해 두면 별도의 설정이 없을 때도 안전하게 동작합니다.

Suggested change
@Scheduled(cron = "0 8 15 * * *", zone = "Asia/Seoul")
@Scheduled(cron = "${schedules.alarm.event:0 8 15 * * *}", zone = "Asia/Seoul")

public void sendEventAlarms() {
regionalAlarmCommandService.dispatchScheduledEventAlarms();
}

// 기존 설정 시각
//@Scheduled(cron = "0 0 10 * * *", zone = "Asia/Seoul")
@Scheduled(cron = "1 0 14 * * *", zone = "Asia/Seoul")
@Scheduled(cron = "1 8 15 * * *", zone = "Asia/Seoul")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

상점 알림 스케줄러의 cron 표현식도 외부 설정을 통해 관리할 수 있도록 플레이스홀더 형식으로 개선하는 것을 권장합니다.

Suggested change
@Scheduled(cron = "1 8 15 * * *", zone = "Asia/Seoul")
@Scheduled(cron = "${schedules.alarm.store:1 8 15 * * *}", zone = "Asia/Seoul")

public void sendStoreAlarms() {
regionalAlarmCommandService.dispatchScheduledStoreAlarms();
}

// 기존 설정 시각
//@Scheduled(cron = "0 0 18 * * *", zone = "Asia/Seoul")
@Scheduled(cron = "2 0 14 * * *", zone = "Asia/Seoul")
@Scheduled(cron = "2 8 15 * * *", zone = "Asia/Seoul")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

인기 알림 스케줄러의 cron 표현식도 외부 설정을 통해 관리할 수 있도록 플레이스홀더 형식으로 개선하는 것을 권장합니다.

Suggested change
@Scheduled(cron = "2 8 15 * * *", zone = "Asia/Seoul")
@Scheduled(cron = "${schedules.alarm.hot:2 8 15 * * *}", zone = "Asia/Seoul")

public void sendHotAlarms() {
hotAlarmCommandService.dispatchScheduledHotAlarms();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class PinGeoScheduler {
private final PinGeoRedisService pinGeoRedisService;
private final RedisTemplate<String, String> redisTemplate;

@Scheduled(cron = "0 25 13 * * *", zone = "Asia/Seoul")
@Scheduled(cron = "0 0 5 * * *", zone = "Asia/Seoul")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

캐시 재구성 스케줄러의 cron 표현식도 외부 설정을 통해 관리할 수 있도록 플레이스홀더 형식으로 개선하는 것을 권장합니다.

Suggested change
@Scheduled(cron = "0 0 5 * * *", zone = "Asia/Seoul")
@Scheduled(cron = "${schedules.geo.rebuild:0 0 5 * * *}", zone = "Asia/Seoul")

public void rebuildGeoCache() {
// SET lock:geo:rebuild 1 NX PX 600000 — 원자적 명령으로 레이스 컨디션 없음
Boolean acquired = redisTemplate.opsForValue()
Expand Down
Loading