Conversation
|
실패하는 테스트코드가 있어 PR이 자동으로 닫혔습니다. |
jjjh02
reviewed
Apr 28, 2025
| updateAndRescheduleNotification(newNotificationTime, notification); | ||
| } | ||
|
|
||
| private void updateAndRescheduleNotification(LocalDateTime newNotificationTime, NotificationSchedule notification) { |
Contributor
There was a problem hiding this comment.
현재 modifySchedule 안에서 notificationschedule 수정하는 로직에서 scheduleTime이 변경되지 않았더라도 항상 알림 스케줄이 취소되고 다시 등록되는 흐름으로 보입니다. 혹시 현재 방식을 선택한 특별한 이유나 고려한 상황이 있을까요?
이렇게 하면 실질적으로 변경이 없는 경우에도 DB 업데이트 및 스케줄러 리스케줄 작업이 매번 발생하게 되어 성능상 불필요한 비용이 발생할 수 있습니다. scheduleTime 변경 여부를 먼저 비교한 후, 변경된 경우에만 NotificationSchedule을 취소/재등록하는 방식으로 최적화하면 좋을 것 같아서요.!
Contributor
Author
There was a problem hiding this comment.
엇 제가 스케줄 수정 API를 수정하는 필드만 보내는것으로 착각했었네요
수정해서 푸시했습니다~
Contributor
|
이전 로직에 비해 전체적으로 성능과 최적화 측면이 훨씬 개선된 게 느껴지네요~ 수고하셨습니다!! |
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.
작업 배경
기존에는 매 분마다
Select * from schedule where time=현재시각+5분위 쿼리를 실행 해 모든 약속을 순회하며 5분뒤의 약속을 조회했었음.
즉, 약속이 없는 시각에도 불필요하게 스케줄링 작업을 실행하여 메모리를 낭비했었음.
따라서 약속 생성 시점에 알림을 동적으로 등록하여 이후에는 따로 약속을 스캔할 필요 없이 스케줄링이 되게 로직을 변경하였고, 그 과정에서 알림테이블 생성, 비동기 처리 등 최적화 작업을 진행하였음.
주요 변경사항
Closed #212