Open
Conversation
ysw789
requested changes
Feb 23, 2026
Contributor
ysw789
left a comment
There was a problem hiding this comment.
- 추가적으로 Slf4j로 로깅은 실패한 경우에만 남기도록 하면 로깅이 깔끔할 것 같습니다
| } | ||
|
|
||
| @Override | ||
| @Scheduled(cron = "0 0 0 * * *", zone = "Asia/Seoul") |
Contributor
There was a problem hiding this comment.
서버 기준으로 이미 JVM 시간대 설정이 Asia/Seoul로 설정되어있어서 (Dockerfile 참조) zone 설정이 필수는 아닐 것 같긴 한데
이미 Asia/Seoul 시간대인데 또 시간대 보정을 위해 -9 시간 하는 로직인지 확인할 필욘 있어보여요
| .atTime(schedule.getEndTime()); | ||
|
|
||
| // 이미 확정된 근무와 겹치면 자동 생성하지 않는다 | ||
| if (workspaceShiftQueryRepository.hasConflictingSchedule(workspaceWorker, startDateTime, endDateTime)) { |
Contributor
There was a problem hiding this comment.
지금은 워크스페이스를 하나씩 순회하며 generateShiftsForWorkspace()를 호출하고, 그 안에서 다시 스케줄 × 주 수만큼 hasConflictingSchedule() 쿼리를 반복 호출하고 있습니다
쿼리가 (워크스페이스 수 × 스케줄 수 × 주수)번 발생하고, saveAll()도 워크스페이스마다 따로 호출됩니다
조회된 전체 고정 근무 일정을 기준으로 충돌 케이스를 DB 쿼리로 일괄 필터링하도록 하면 쿼리를 크게 줄일 수 있을 것 같습니다
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
관련 문서
https://www.notion.so/BE-2e48655316288034b5dee987f3b79742?source=copy_link