redis_cluster 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/redis_cluster/client.rb +1 -1
- data/lib/redis_cluster/node.rb +1 -1
- data/lib/redis_cluster/pool.rb +5 -4
- data/lib/redis_cluster/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c54c99a524bcd4562da35cacbf34aebf94233328
|
4
|
+
data.tar.gz: a8551e253aa66076ce77b6b2c734a6ed2a35cbb5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f84bc375e7a74c4f9535588072eb2fd173bd3d4a61b73963ae146ccbbab2ff149771bb6f77f38df3030875af9e3d73b16254c2969156b9f0a62c730c6add9fea
|
7
|
+
data.tar.gz: aa14e6c5c909563293f1e7bffcb0f028830b1b9b35fca70547758ebe3de1793fe08ef0d40f680944b6344a32e49d78ca606a12a38eefff625ca6e8b806454b9c
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# RedisCluster
|
2
2
|
|
3
|
-
RedisCluster is rewrited from [https://github.com/antirez/redis-rb-cluster](https://github.com/antirez/redis-rb-cluster)
|
3
|
+
RedisCluster for ruby is rewrited from [https://github.com/antirez/redis-rb-cluster](https://github.com/antirez/redis-rb-cluster)
|
4
4
|
|
5
5
|
Now is developing, and not use in any production environments. Welcome to test and contribute codes!
|
6
6
|
|
data/lib/redis_cluster/client.rb
CHANGED
@@ -23,7 +23,7 @@ module RedisCluster
|
|
23
23
|
sleep 0.1 if ttl < Configuration::REQUEST_TTL/2
|
24
24
|
rescue => e
|
25
25
|
err_code = e.to_s.split.first
|
26
|
-
raise e
|
26
|
+
raise e unless %w(MOVED ASK).include?(err_code)
|
27
27
|
|
28
28
|
if err_code == "ASK"
|
29
29
|
asking = true
|
data/lib/redis_cluster/node.rb
CHANGED
data/lib/redis_cluster/pool.rb
CHANGED
@@ -7,15 +7,16 @@ module RedisCluster
|
|
7
7
|
@nodes = []
|
8
8
|
end
|
9
9
|
|
10
|
-
|
11
|
-
|
10
|
+
# TODO: type check
|
11
|
+
def add_node!(node_options, slots)
|
12
|
+
new_node = Node.new(node_options)
|
12
13
|
node = @nodes.find {|n| n.name == new_node.name } || new_node
|
13
14
|
node.slots = slots
|
14
15
|
@nodes.push(node).uniq!
|
15
16
|
end
|
16
17
|
|
17
|
-
def delete_except!(
|
18
|
-
names =
|
18
|
+
def delete_except!(master_hosts)
|
19
|
+
names = master_hosts.map {|host, port| "#{host}:#{port}" }
|
19
20
|
@nodes.delete_if {|n| !names.include?(n.name) }
|
20
21
|
end
|
21
22
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redis_cluster
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- wangzc
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis
|