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

Ring Keys() command should aggregate results from each shard. #388

Closed
didip opened this issue Oct 6, 2016 · 1 comment
Closed

Ring Keys() command should aggregate results from each shard. #388

didip opened this issue Oct 6, 2016 · 1 comment

Comments

@didip
Copy link

didip commented Oct 6, 2016

The current behavior picks one server and runs Keys(), I think that's not correct.

@vmihailenco
Copy link
Collaborator

It is easy to do it for Keys but Redis has so many commands that I don't even want to start going this way. But you can use ForEachShard:

err := ring.ForEachShard(func(client *redis.Client) error {
    keys, err := client.Keys()
    fmt.Println(keys)
    return err
})

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