Skip to content

Correctly pass @options to Async::Redis::Client instances created by Async::Redis::ClusterClient. #60

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

Merged
merged 1 commit into from
Feb 28, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/async/redis/cluster_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def clear
# @property endpoints [Array(Endpoint)] The list of cluster endpoints.
def initialize(endpoints, **options)
@endpoints = endpoints
@options = options
@shards = nil
end

Expand Down Expand Up @@ -93,15 +94,15 @@ def client_for(slot, role = :master)
end

if node = nodes.sample
return (node.client ||= Client.new(node.endpoint))
return (node.client ||= Client.new(node.endpoint, **@options))
end
end

protected

def reload_cluster!(endpoints = @endpoints)
@endpoints.each do |endpoint|
client = Client.new(endpoint)
client = Client.new(endpoint, **@options)

shards = RangeMap.new
endpoints = []
Expand Down
Loading