提交 62c4e4d3 编写于 作者: E Edgars Beigarts 提交者: José Valim

Fix connection reloading in development mode. [#4929 state:resolved]

Signed-off-by: NJosé Valim <jose.valim@gmail.com>
上级 c0fc084e
......@@ -144,7 +144,9 @@ def clear_reloadable_connections!
@connections.each do |conn|
conn.disconnect! if conn.requires_reloading?
end
@connections = []
@connections.delete_if do |conn|
conn.requires_reloading?
end
end
# Verify active connections and remove and disconnect connections
......
......@@ -142,9 +142,10 @@ def reset!
# this should be overridden by concrete adapters
end
# Returns true if its safe to reload the connection between requests for development mode.
# Returns true if its required to reload the connection between requests for development mode.
# This is not the case for Ruby/MySQL and it's not necessary for any adapters except SQLite.
def requires_reloading?
true
false
end
# Checks whether the connection to the database is still active (i.e. not stale).
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册