Skip to content

Comments

feat: 스케줄 자동 생성 스케줄러#64

Open
juny0955 wants to merge 2 commits intodevfrom
feat/ALT-141
Open

feat: 스케줄 자동 생성 스케줄러#64
juny0955 wants to merge 2 commits intodevfrom
feat/ALT-141

Conversation

@juny0955
Copy link
Contributor

@juny0955 juny0955 commented Feb 19, 2026

@juny0955 juny0955 requested review from hodoon and ysw789 February 19, 2026 11:35
@juny0955 juny0955 self-assigned this Feb 19, 2026
@juny0955 juny0955 added the FEAT label Feb 19, 2026
Copy link
Contributor

@ysw789 ysw789 left a comment

Choose a reason for hiding this comment

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

  • 추가적으로 Slf4j로 로깅은 실패한 경우에만 남기도록 하면 로깅이 깔끔할 것 같습니다

}

@Override
@Scheduled(cron = "0 0 0 * * *", zone = "Asia/Seoul")
Copy link
Contributor

@ysw789 ysw789 Feb 23, 2026

Choose a reason for hiding this comment

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

서버 기준으로 이미 JVM 시간대 설정이 Asia/Seoul로 설정되어있어서 (Dockerfile 참조) zone 설정이 필수는 아닐 것 같긴 한데
이미 Asia/Seoul 시간대인데 또 시간대 보정을 위해 -9 시간 하는 로직인지 확인할 필욘 있어보여요

.atTime(schedule.getEndTime());

// 이미 확정된 근무와 겹치면 자동 생성하지 않는다
if (workspaceShiftQueryRepository.hasConflictingSchedule(workspaceWorker, startDateTime, endDateTime)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

지금은 워크스페이스를 하나씩 순회하며 generateShiftsForWorkspace()를 호출하고, 그 안에서 다시 스케줄 × 주 수만큼 hasConflictingSchedule() 쿼리를 반복 호출하고 있습니다
쿼리가 (워크스페이스 수 × 스케줄 수 × 주수)번 발생하고, saveAll()도 워크스페이스마다 따로 호출됩니다
조회된 전체 고정 근무 일정을 기준으로 충돌 케이스를 DB 쿼리로 일괄 필터링하도록 하면 쿼리를 크게 줄일 수 있을 것 같습니다

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants