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

go-redis/v8 v8.11.4:BLPOP and BRPOP timeout issue #2977

Closed
ksppg opened this issue Apr 18, 2024 · 1 comment
Closed

go-redis/v8 v8.11.4:BLPOP and BRPOP timeout issue #2977

ksppg opened this issue Apr 18, 2024 · 1 comment

Comments

@ksppg
Copy link

ksppg commented Apr 18, 2024

https://www.jianshu.com/p/a41b62c2afab

@monkey92t
Copy link
Collaborator

In go-redis, when executing BLPOP/BRPOP, the command's timeout parameter will override the default timeout, so the timeout setting comes from the user.

func (c cmdable) BLPop(ctx context.Context, timeout time.Duration, keys ...string) *StringSliceCmd {
	args := make([]interface{}, 1+len(keys)+1)
	args[0] = "blpop"
	for i, key := range keys {
		args[1+i] = key
	}
	args[len(args)-1] = formatSec(ctx, timeout)
	cmd := NewStringSliceCmd(ctx, args...)
	cmd.setReadTimeout(timeout)
	_ = c(ctx, cmd)
	return cmd
}

Do you mean something else?

@ksppg ksppg closed this as completed Apr 19, 2024
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

No branches or pull requests

2 participants