Skip to content

Conversation

@kooks7
Copy link
Contributor

@kooks7 kooks7 commented May 26, 2025

PR 의 종류는 어떤 것인가요?

  • 버그 수정
  • 새로운 기능
  • 리팩토링
  • 문서 수정
  • 워크플로우 수정

수정이 필요하게된 이유가 무엇인가요? (Jira 이슈가 있다면 링크를 연결해주세요)

여러 동작을 실행하는 경우 multi를 사용하도록 변경합니다.

무엇을 어떻게 변경했나요?

코드 변경을 이해하기 위한 배경지식이 필요하다면 설명 해주세요.

디펜던시 변경이 있나요?

어떻게 테스트 하셨나요?

테스트 코드

코드의 실행결과를 볼 수 있는 로그나 이미지가 있다면 첨부해주세요.

@kooks7 kooks7 self-assigned this May 26, 2025
@day1-dev-adm day1-dev-adm added the enhancement New feature or request label May 26, 2025
@kooks7 kooks7 force-pushed the feat/sorted-set-with-temp-key branch from b332a72 to 121f70d Compare May 26, 2025 07:10
@kooks7 kooks7 changed the title feat: 임시 키 관련 메소드 추가 및 테스트 케이스 작성 feat: 여러 동작을 실행하는 경우 multi를 사용하도록 변경 May 26, 2025
@kooks7
Copy link
Contributor Author

kooks7 commented May 26, 2025

@elegantcoder 현진님 감사합니다! multi 사용하도록 수정했습니다

key,
add: async (score: number, value: string): Promise<void> => {
await this.client.zadd(key, score, value);
const multi = this.client.multi();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 경우 (single add)에도 multi 를 사용하는거에요?

  1. client.zadd 보다 성능이 더 좋거나.
  2. api 디자인 일관성을 위해

Copy link
Contributor Author

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();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

데이터베이스 트랜젝션처럼 처리하는군요~ api 디자인이 일관성이 생겨서 좋은 거 같습니다.

Copy link

@elegantcoder elegantcoder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

좋네요~ 수고하셨습니다.

@kooks7 kooks7 merged commit b30dbc1 into main May 26, 2025
1 check passed
@kooks7 kooks7 deleted the feat/sorted-set-with-temp-key branch May 26, 2025 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants