class ActiveRecord::ConnectionAdapters::ConnectionPool

def flush(minimum_idle = @idle_timeout)

checked in less than +minimum_idle+ seconds ago, are unaffected.
+minimum_idle+ seconds. Connections currently checked out, or that were
Disconnect all connections that have been idle for at least
def flush(minimum_idle = @idle_timeout)
  return if minimum_idle.nil?
  idle_connections = synchronize do
    return if self.discarded?
    @connections.select do |conn|
      !conn.in_use? && conn.seconds_idle >= minimum_idle
    end.each do |conn|
      conn.lease
      @available.delete conn
      @connections.delete conn
    end
  end
  idle_connections.each do |conn|
    conn.disconnect!
  end
end