-
Notifications
You must be signed in to change notification settings - Fork 0
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
[#241] 랭킹에 로컬 캐시 적용 #244
[#241] 랭킹에 로컬 캐시 적용 #244
Conversation
@@ -9,9 +9,15 @@ public enum CacheType { | |||
|
|||
POLYGON("polygon", Integer.MAX_VALUE, 1000), | |||
ADDRESS("address", Integer.MAX_VALUE, 1000), | |||
RANKING("ranking", Constants.SIX_HOURS_IN_SECONDS, 10), |
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.
p2
마지막에 들어가는 10
의 경우 Key와 Value로 이루어진 엔트리의 개수로 알고 있습니다! 현재 배포된 페이지에서는 Ranking에 나오는 Crew의 개수가 10개로 제한되어 있지는 않은 것 같은데 앞으로는 10개만 보여주는 것일까요?!
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.
랭킹 캐시의 경우 하나의 Key에 List<RankingResponse>의 형태로 모든 랭킹 정보를 담고 있습니다. 크루 랭킹의 경우 crew라는 Key에 List<CrewRankingResponse>를 담고 있는데요. 따라서 마지막 값을 10으로 설정해도 모든 크루 랭킹 정보를 저장할 수 있습니다.👍👍
사실 마지막 값을 1로 설정해도 정상적으로 동작하는 상황이기에 값을 어떻게 설정하는 것이 좋을지 고민이 되었는데요. 향후 멤버 랭킹, 경기 랭킹 등이 추가될 것을 대비해서 10정도로 설정해보았습니다.😁😀😊
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.
아하 리스트군요~! 감사합니다! ㅎㅎ
List<CrewRankingResponse> crewRankings = rankingJdbcRepository.getCrewRankings(); | ||
System.out.println(crewRankings.size() + "개의 크루 랭킹 갱신"); |
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.
P1
- 일단 crewRankings에 final 붙여야 할 것 같아요
- sout 보다는 log로 남기는게 어떨까요?
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.
적용 커밋 : 137393c
- final 삽입하였습니다. 꼼꼼한 리뷰 감사합니다~~😊😊
- sout은 캐싱이 잘 동작하는지 확인해보기 위해 개인 디버깅 용도로 붙여두었던 것인데 실수로 커밋에 포함시켰네요ㅜㅜ. 해당 라인 삭제하였습니다. 감사합니다~👍👍
137393c
to
c82d4ab
Compare
Kudos, SonarCloud Quality Gate passed! |
관련 PR 목록
1. 크루 랭킹 기능
2. 랭킹에 로컬 캐시 적용
3. 크루 랭킹의 캐시 저장소 변경, 캐싱 스케줄러의 중복 실행 방지
👨💻 작업 사항
📑 PR 개요
✅ 작업 목록
📀 관련 데이터 (화면, 테이블, API 등)
화면
테이블 명
API endpoint
반환 예시
Prefix
P1
: 꼭 반영해주세요 (Request changes)P2
: 적극적으로 고려해주세요 (Request changes)P3
: 웬만하면 반영해 주세요 (Comment)P4
: 반영해도 좋고 넘어가도 좋습니다 (Approve)P5
: 그냥 사소한 의견입니다 (Approve)