提交 160cc331 编写于 作者: S Sean Griffin

Don't attempt to clear active connections unless we'ere connected

Right now with this middleware we are likely always connected, but I'm
hoping to change that soon. This is an easy change to pull out on its
own.
上级 4565de0d
......@@ -40,7 +40,7 @@ def self.install_executor_hooks(executor = ActiveSupport::Executor)
executor.register_hook(self)
executor.to_complete do
unless ActiveRecord::Base.connection.transaction_open?
unless ActiveRecord::Base.connected? && ActiveRecord::Base.connection.transaction_open?
ActiveRecord::Base.clear_active_connections!
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册