提交 11d2a309 编写于 作者: M Michael Koziarski

Make clear_reloadable_connections! take account of @@allow_concurrency. Closes #7579 [wilson]


git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8014 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 192e463d
......@@ -89,10 +89,23 @@ def clear_active_connections!
# Clears the cache which maps classes
def clear_reloadable_connections!
@@active_connections.each do |name, conn|
if conn.requires_reloading?
conn.disconnect!
@@active_connections.delete(name)
if @@allow_concurrency
# With concurrent connections @@active_connections is
# a hash keyed by thread id.
@@active_connections.each do |thread_id, conns|
conns.each do |name, conn|
if conn.requires_reloading?
conn.disconnect!
@@active_connections[thread_id].delete(name)
end
end
end
else
@@active_connections.each do |name, conn|
if conn.requires_reloading?
conn.disconnect!
@@active_connections.delete(name)
end
end
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册