redis 2.0.5 → 2.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/redis.rb +5 -5
  2. data/lib/redis/client.rb +9 -7
  3. metadata +3 -3
@@ -1,7 +1,7 @@
1
1
  require 'socket'
2
2
 
3
3
  class Redis
4
- VERSION = "2.0.5"
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] = url.host
26
- options[:port] = url.port
27
- options[:password] = url.password
28
- options[:db] = url.path[1..-1].to_i
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
@@ -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
- ensure_connected do
108
- begin
109
- self.timeout = 0
110
- yield
111
- ensure
112
- self.timeout = @timeout if connected?
113
- end
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
- - 5
9
- version: 2.0.5
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-30 00:00:00 -03:00
24
+ date: 2010-09-07 00:00:00 -03:00
25
25
  default_executable:
26
26
  dependencies: []
27
27