RUBY-444
Additional fix for threading tests to ensure a manager for a new thread is always set.
This commit is contained in:
parent
a3555ba404
commit
4df2564519
|
@ -401,10 +401,16 @@ module Mongo
|
|||
end
|
||||
end
|
||||
|
||||
def get_socket_from_pool(pool_type)
|
||||
if Thread.current[:managers] && Thread.current[:managers][self] != @manager
|
||||
def ensure_manager
|
||||
Thread.current[:managers] ||= Hash.new
|
||||
|
||||
if Thread.current[:managers][self] != @manager
|
||||
Thread.current[:managers][self] = @manager
|
||||
end
|
||||
end
|
||||
|
||||
def get_socket_from_pool(pool_type)
|
||||
ensure_manager
|
||||
|
||||
pool = case pool_type
|
||||
when :primary
|
||||
|
|
Loading…
Reference in New Issue