Skip to content

Commit ae16175

Browse files
committed
Failing test.
1 parent 6a75f89 commit ae16175

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

cluster/test/async/redis/cluster_client.rb

+8
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,12 @@
4343

4444
expect(result).to be == value
4545
end
46+
47+
it "can map every slot to a client" do
48+
Async::Redis::ClusterClient::HASH_SLOTS.times do |slot|
49+
client = cluster.client_for(slot)
50+
51+
expect(client).not.to be_nil
52+
end
53+
end
4654
end

lib/async/redis/cluster_client.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,10 @@ def crc16(bytes)
179179
return sum
180180
end
181181

182-
HASH_SLOTS = 16_384
183-
184182
public
185183

184+
HASH_SLOTS = 16_384
185+
186186
# Return Redis::Client for a given key.
187187
# Modified from https://github.com/antirez/redis-rb-cluster/blob/master/cluster.rb#L104-L117
188188
def slot_for(key)

0 commit comments

Comments
 (0)