Method: WithConnection::ConnectionPool#checkout_with_debug

Defined in:
lib/with_connection/connection_pool.rb

#checkout_with_debugObject



33
34
35
36
37
38
39
40
41
42
43
# File 'lib/with_connection/connection_pool.rb', line 33

def checkout_with_debug
  if @debug_with_connection && ! @using_with_connection
    Rails.logger.warn "#{name} not using with_connection, backtrace: #{caller.inspect}"
  end

  begin
    checkout_without_debug
  rescue ActiveRecord::ConnectionTimeoutError => e
    raise ActiveRecord::ConnectionTimeoutError, "could not obtain a #{name} connection#{" within #{@timeout} seconds" if @timeout}.  The max pool size is currently #{@size}; consider increasing it."
  end
end