-
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
[chore] Redis Key Name 난잡한 상황 개선 (#129) #132
Conversation
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.
남은 시간 동안 잔여 버그를 수정하고, SonarLint 정적분석 도구를 통해 불필요한 코드나 구조를 개선하겠습니다.
// 선착순 이벤트 마감 여부 tag | ||
public static String endFlagFormatting(String key) { | ||
return key + ":end"; | ||
return formatKey(key, "end"); | ||
} | ||
|
||
// 선착순 이벤트 당첨자 tag | ||
public static String winnerFormatting(String key) { | ||
return key + ":winner"; | ||
return formatKey(key, "winner"); | ||
} | ||
|
||
// 선착순 이벤트 참여자 tag | ||
public static String participantFormatting(String key) { | ||
return key + ":participant"; | ||
return formatKey(key, "participant"); | ||
} | ||
|
||
// 선착순 이벤트 정답 tag | ||
public static String answerFormatting(String key) { | ||
return key + ":answer"; | ||
return formatKey(key, "answer"); | ||
} | ||
|
||
// 공통 로직을 처리하는 메서드 | ||
private static String formatKey(String key, String suffix) { | ||
return FCFS_PREFIX + key + ":" + suffix; | ||
} |
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는 [숫자]:[역할]로 구성되어 확장성이 떨어졌기에, 별도의 PREFIX를 추가하여 의미를 명확하게 하고자 했습니다.
// 선착순 이벤트 tag | ||
public static String keyFormatting(String key) { | ||
return key + ":fcfs"; | ||
return formatKey(key, "count"); | ||
} |
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.
한편, 기존 2:fcfs 형태의 key는 참여 가능한 사람 수를 저장하는 용도였는데, fcfs:2:fcfs와 같은 어색한 표현을 피하고자 count로 명확하게 수정했습니다.
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.
고생하셨습니다. redis 키 이름을 처음 봤을 때 차후 이해하기 어려울 수도 있을 것이라 생각했는데, fcfs prefix를 추가해서 이전보다 더 redis에 들어가는 데이터의 의미가 명확해진 것 같습니다.
#️⃣ 연관 이슈
📝 작업 내용
참고 이미지 및 자료
💬 리뷰 요구사항