-
Notifications
You must be signed in to change notification settings - Fork 1
feat: 여러 동작을 실행하는 경우 multi를 사용하도록 변경 #33
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
Conversation
b332a72 to
121f70d
Compare
|
@elegantcoder 현진님 감사합니다! multi 사용하도록 수정했습니다 |
| key, | ||
| add: async (score: number, value: string): Promise<void> => { | ||
| await this.client.zadd(key, score, value); | ||
| const multi = this.client.multi(); |
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.
이 경우 (single add)에도 multi 를 사용하는거에요?
- client.zadd 보다 성능이 더 좋거나.
- api 디자인 일관성을 위해
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.
네 single add에도 expire로 ttl을 설정해주다보니 transaction 처럼 multi를 사용해두었습니다!
| await this.client.expire(tempKey, 60); | ||
| await this.client.rename(tempKey, key); | ||
|
|
||
| const multi = this.client.multi(); |
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.
데이터베이스 트랜젝션처럼 처리하는군요~ api 디자인이 일관성이 생겨서 좋은 거 같습니다.
elegantcoder
left a comment
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.
좋네요~ 수고하셨습니다.
PR 의 종류는 어떤 것인가요?
수정이 필요하게된 이유가 무엇인가요? (Jira 이슈가 있다면 링크를 연결해주세요)
여러 동작을 실행하는 경우 multi를 사용하도록 변경합니다.
무엇을 어떻게 변경했나요?
코드 변경을 이해하기 위한 배경지식이 필요하다면 설명 해주세요.
디펜던시 변경이 있나요?
어떻게 테스트 하셨나요?
테스트 코드
코드의 실행결과를 볼 수 있는 로그나 이미지가 있다면 첨부해주세요.