Skip to content
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

Why redis.Exists() accept only one key in go-zero? #3765

Closed
striveQiao opened this issue Dec 8, 2023 · 2 comments · Fixed by #3769
Closed

Why redis.Exists() accept only one key in go-zero? #3765

striveQiao opened this issue Dec 8, 2023 · 2 comments · Fixed by #3769

Comments

@striveQiao
Copy link

striveQiao commented Dec 8, 2023

func (s *Redis) ExistsCtx(ctx context.Context, key string) (val bool, err error) {
err = s.brk.DoWithAcceptable(func() error {
conn, err := getRedis(s)
if err != nil {
return err
}

	v, err := conn.Exists(ctx, key).Result() // 这里go-redis是可以传入批量key的
	if err != nil {
		return err
	}

	val = v == 1
	return nil
}, acceptable)

return

}
这里可以加入多个传入吗,为什么只能传入单个啊

@kevwan kevwan changed the title 为什么go-zero 里面的redis.Exists()只能传一个key Why redis.Exists() accept only one key in go-zero? Dec 9, 2023
@kevwan
Copy link
Contributor

kevwan commented Dec 9, 2023

Woud you please submit a PR?

@codeErrorSleep
Copy link
Contributor

I am interested in this issue and hope to assist in resolving it.Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants