-
Notifications
You must be signed in to change notification settings - Fork 0
[TEST] 스케쥴링 시간 조정 완 #348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TEST] 스케쥴링 시간 조정 완 #348
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -17,21 +17,21 @@ public class AlarmSchedulerService { | |||||
|
|
||||||
| // 기존 설정 시각 | ||||||
| //@Scheduled(cron = "0 0 13 * * *", zone = "Asia/Seoul") | ||||||
| @Scheduled(cron = "0 30 22 * * *", zone = "Asia/Seoul") | ||||||
| @Scheduled(cron = "0 5 15 * * *", zone = "Asia/Seoul") | ||||||
| public void sendEventAlarms() { | ||||||
| regionalAlarmCommandService.dispatchScheduledEventAlarms(); | ||||||
| } | ||||||
|
|
||||||
| // 기존 설정 시각 | ||||||
| //@Scheduled(cron = "0 0 10 * * *", zone = "Asia/Seoul") | ||||||
| @Scheduled(cron = "0 30 22 * * *", zone = "Asia/Seoul") | ||||||
| @Scheduled(cron = "2 5 15 * * *", zone = "Asia/Seoul") | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 스토어 알림 스케줄링 주기도 설정 파일로 분리하여 관리하는 것을 권장합니다.\n\n추가로, 현재 각 스케줄러 간의 간격이 2초(15:05:00, 15:05:02, 15:05:04)로 매우 짧게 설정되어 있습니다. Spring의 기본 스케줄러는 단일 스레드(Single-threaded)로 동작하므로, 앞선 작업(sendEventAlarms)이 2초 이상 걸릴 경우 뒤이어 실행되어야 할 sendStoreAlarms 작업이 지연될 수 있습니다. 스케줄러 스레드 풀 설정을 확인하시거나 작업 간의 간격을 충분히 넓히는 것을 고려해 주세요.
Suggested change
|
||||||
| public void sendStoreAlarms() { | ||||||
| regionalAlarmCommandService.dispatchScheduledStoreAlarms(); | ||||||
| } | ||||||
|
|
||||||
| // 기존 설정 시각 | ||||||
| //@Scheduled(cron = "0 0 18 * * *", zone = "Asia/Seoul") | ||||||
| @Scheduled(cron = "0 30 22 * * *", zone = "Asia/Seoul") | ||||||
| @Scheduled(cron = "4 5 15 * * *", zone = "Asia/Seoul") | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||
| public void sendHotAlarms() { | ||||||
| hotAlarmCommandService.dispatchScheduledHotAlarms(); | ||||||
| } | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
스케줄링 주기(cron 표현식)가 소스 코드에 하드코딩되어 있어, 테스트나 환경별(로컬, 개발, 운영)로 주기를 변경할 때마다 코드를 직접 수정해야 하는 불편함이 있습니다. 이를
application.yml등의 설정 파일로 분리하여@Scheduled(cron = "${schedules.event-alarm}")형태로 관리하는 것을 권장합니다.