Merged
Conversation
Kyoungwoong
reviewed
Jun 26, 2025
src/test/java/org/myteam/server/RedisRedissonTest/RedisAndRedissonRecommendTest.java
Outdated
Show resolved
Hide resolved
Kyoungwoong
approved these changes
Jun 26, 2025
dong3058
approved these changes
Jun 26, 2025
|
고생많으셨습니다. |
|
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.




기능 설명
작업 내용
추천 중복 방지 로직 정비
Redis Set 자료구조를 이용해 추천 중복을 방지합니다.
Key 형식: recommend:users:{콘텐츠타입}:{콘텐츠ID}
추천 시, 해당 Set에 사용자 ID를 추가하고, 이미 존재할 경우 예외를 발생시킵니다.
추천 취소 시, 사용자 ID를 Set에서 제거하고 Hash의 추천 수를 -1 처리합니다.
게시글 삭제 시 캐시 정리 기능 추가
게시글 삭제와 동시에 관련 Redis 캐시(Key) 를 명시적으로 삭제합니다.
삭제 대상:
조회수/댓글수/추천수를 담고 있는 Hash: count:{content Type}:{contentId}
추천자 목록을 담고 있는 Set: recommend:users:{content Type}}:{contentId}
비교 Test 코드는 계속 실행될 필요가 없어보여 주석처리 했습니다!
테스트코드
100명의 서로 다른 유저가 동시에 추천 요청
결과 측정: 최종 추천 수가 100인지 확인 -> 둘다 추천수 100
전체 처리 시간 측정: Redisson 사용할때 1881 ms -> Redisson 제거 후 733ms
수정 사항
추가 작업 예정
테스트