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
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_socket_from_pool(pool_type)
|
def ensure_manager
|
||||||
if Thread.current[:managers] && Thread.current[:managers][self] != @manager
|
Thread.current[:managers] ||= Hash.new
|
||||||
|
|
||||||
|
if Thread.current[:managers][self] != @manager
|
||||||
Thread.current[:managers][self] = @manager
|
Thread.current[:managers][self] = @manager
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def get_socket_from_pool(pool_type)
|
||||||
|
ensure_manager
|
||||||
|
|
||||||
pool = case pool_type
|
pool = case pool_type
|
||||||
when :primary
|
when :primary
|
||||||
|
Loading…
Reference in New Issue
Block a user