문제
AlertService.checkAndNotify() 루프 안에서:
existsByWatchlistIdAndSentAtAfter를 watchlist 수만큼 호출
- lazy loading
getMember(), getCourse()
해결
- alertLog를 watchlistId IN 쿼리로 일괄 조회 후 메모리 필터
- watchlist 조회 시 member/course
fetch join
영향 파일
watchlist/service/AlertService.java
watchlist/repository/WatchlistRepository.java, AlertLogRepository.java
문제
AlertService.checkAndNotify()루프 안에서:existsByWatchlistIdAndSentAtAfter를 watchlist 수만큼 호출getMember(),getCourse()해결
fetch join영향 파일
watchlist/service/AlertService.javawatchlist/repository/WatchlistRepository.java,AlertLogRepository.java