redis 2.0.5 → 2.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/redis.rb +5 -5
- data/lib/redis/client.rb +9 -7
- metadata +3 -3
data/lib/redis.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'socket'
|
2
2
|
|
3
3
|
class Redis
|
4
|
-
VERSION = "2.0.
|
4
|
+
VERSION = "2.0.6"
|
5
5
|
|
6
6
|
class ProtocolError < RuntimeError
|
7
7
|
def initialize(reply_type)
|
@@ -22,10 +22,10 @@ class Redis
|
|
22
22
|
|
23
23
|
url = URI(options.delete(:url) || ENV["REDIS_URL"] || "redis://127.0.0.1:6379/0")
|
24
24
|
|
25
|
-
options[:host]
|
26
|
-
options[:port]
|
27
|
-
options[:password]
|
28
|
-
options[:db]
|
25
|
+
options[:host] ||= url.host
|
26
|
+
options[:port] ||= url.port
|
27
|
+
options[:password] ||= url.password
|
28
|
+
options[:db] ||= url.path[1..-1].to_i
|
29
29
|
|
30
30
|
new(options)
|
31
31
|
end
|
data/lib/redis/client.rb
CHANGED
@@ -52,6 +52,8 @@ class Redis
|
|
52
52
|
without_socket_timeout do
|
53
53
|
call(*args)
|
54
54
|
end
|
55
|
+
rescue Errno::ECONNRESET
|
56
|
+
retry
|
55
57
|
end
|
56
58
|
|
57
59
|
def process(*commands)
|
@@ -104,13 +106,13 @@ class Redis
|
|
104
106
|
end
|
105
107
|
|
106
108
|
def without_socket_timeout
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
109
|
+
connect unless connected?
|
110
|
+
|
111
|
+
begin
|
112
|
+
self.timeout = 0
|
113
|
+
yield
|
114
|
+
ensure
|
115
|
+
self.timeout = @timeout if connected?
|
114
116
|
end
|
115
117
|
end
|
116
118
|
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 2
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 2.0.
|
8
|
+
- 6
|
9
|
+
version: 2.0.6
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Ezra Zygmuntowicz
|
@@ -21,7 +21,7 @@ autorequire: redis
|
|
21
21
|
bindir: bin
|
22
22
|
cert_chain: []
|
23
23
|
|
24
|
-
date: 2010-07
|
24
|
+
date: 2010-09-07 00:00:00 -03:00
|
25
25
|
default_executable:
|
26
26
|
dependencies: []
|
27
27
|
|