From 2119a28e0abc5f3703dfbc22853035079f4a34da Mon Sep 17 00:00:00 2001 From: Travis Bell Date: Fri, 28 Feb 2025 11:04:33 -0700 Subject: [PATCH] Allow Async::Redis::ClusterClient to accept options. --- lib/async/redis/cluster_client.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/async/redis/cluster_client.rb b/lib/async/redis/cluster_client.rb index 5272da7..99b111d 100644 --- a/lib/async/redis/cluster_client.rb +++ b/lib/async/redis/cluster_client.rb @@ -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 @@ -93,7 +94,7 @@ 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 @@ -101,7 +102,7 @@ def client_for(slot, role = :master) def reload_cluster!(endpoints = @endpoints) @endpoints.each do |endpoint| - client = Client.new(endpoint) + client = Client.new(endpoint, **@options) shards = RangeMap.new endpoints = []