fixed autoreconnect (oops) RUBY-92

This commit is contained in:
Kyle Banker 2010-02-04 18:07:45 -05:00
parent 8495e75e5e
commit b4a95ac116
2 changed files with 7 additions and 0 deletions

View File

@ -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')

View File

@ -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