fixed autoreconnect (oops) RUBY-92
This commit is contained in:
parent
8495e75e5e
commit
b4a95ac116
5
Rakefile
5
Rakefile
@ -76,6 +76,11 @@ namespace :test do
|
||||
t.verbose = true
|
||||
end
|
||||
|
||||
Rake::TestTask.new(:auto_reconnect) do |t|
|
||||
t.test_files = FileList['test/auxillary/autoreconnect_test.rb']
|
||||
t.verbose = true
|
||||
end
|
||||
|
||||
task :drop_databases do |t|
|
||||
puts "Dropping test database..."
|
||||
require File.join(File.dirname(__FILE__), 'lib', 'mongo')
|
||||
|
@ -321,6 +321,7 @@ module Mongo
|
||||
break if is_master || @slave_ok
|
||||
rescue SocketError, SystemCallError, IOError => ex
|
||||
socket.close if socket
|
||||
close
|
||||
false
|
||||
end
|
||||
end
|
||||
@ -513,6 +514,7 @@ module Mongo
|
||||
message += chunk
|
||||
end
|
||||
rescue => ex
|
||||
close
|
||||
raise ConnectionFailure, "Operation failed with the following exception: #{ex}"
|
||||
end
|
||||
message
|
||||
|
Loading…
Reference in New Issue
Block a user