Permalink
Browse files

Blidly retrying may be usafe.

  • Loading branch information...
1 parent b9e565b commit e4d47cf1981a23603ce262020d23d7d9da40e067 @mmcgrana committed Jan 9, 2010
Showing with 2 additions and 12 deletions.
  1. +1 −1 fleet.gemspec
  2. +1 −11 lib/fleet.rb
View
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = "fleet"
- s.version = "0.1.6"
+ s.version = "0.1.7"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Mark McGranaghan"]
View
@@ -18,7 +18,7 @@ def initialize(options = {})
def query(q)
request = @json_encoder.encode(q)
- response = write_and_read_with_retry(request)
+ response = write_and_read(request)
status, value = @json_parser.parse(response)
case status
when 0
@@ -57,16 +57,6 @@ def disconnect
@socket = nil
end
- def write_and_read_with_retry(request)
- begin
- write_and_read(request)
- rescue Errno::ECONNRESET, Errno::EPIPE, Errno::ECONNABORTED, Timeout::Error
- disconnect
- connect
- write_and_read(request)
- end
- end
-
def write_and_read(request)
with_timeout do
@socket.write(request)

0 comments on commit e4d47cf

Please sign in to comment.