Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/shared/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb b/shared/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
- index aac84cc..cadedd4 100644
- --- a/shared/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
- +++ b/shared/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
- @@ -180,6 +180,7 @@ module ActiveRecord
- # within the timeout period.
- def checkout
- # Checkout an available connection
- + Rails.logger.info "***DBFUCK***Attempting to check out a connection. #{caller.inspect}"
- @connection_mutex.synchronize do
- loop do
- conn = if @checked_out.size < @connections.size
- @@ -188,8 +189,10 @@ module ActiveRecord
- checkout_new_connection
- end
- return conn if conn
- + Rails.logger.info "***DBFUCK***No connections available in pool, and too full"
- # No connections available; wait for one
- if @queue.wait(@timeout)
- + Rails.logger.info "***DBFUCK***waited, trying again."
- next
- else
- # try looting dead threads
- @@ -242,20 +245,24 @@ module ActiveRecord
- end
- def checkout_new_connection
- + Rails.logger.info "***DBFUCK***Checking out a new connection"
- c = new_connection
- @connections << c
- checkout_and_verify(c)
- end
- def checkout_existing_connection
- + Rails.logger.info "***DBFUCK***Checking out an existing connection"
- c = (@connections - @checked_out).first
- checkout_and_verify(c)
- end
- def checkout_and_verify(c)
- + Rails.logger.info "***DBFUCK***Verifying it"
- c.verify!
- c.run_callbacks :checkout
- @checked_out << c
- + Rails.logger.info "***DBFUCK***Checked out!"
- c
- end
- end
- diff --git a/store/config/environments/production.rb b/store/config/environments/production.rb
- index 8dc2ea0..48fd80b 100644
- --- a/store/config/environments/production.rb
- +++ b/store/config/environments/production.rb
- @@ -33,4 +33,6 @@ config.after_initialize do
- ActionController::Base.session_options[:domain] = '.pragprog.com'
- ActionMailer::Base.logger = nil
- IcontactSync.enabled = true
- -end
- \ No newline at end of file
- +end
- +
- +config.log_level = :debug
- \ No newline at end of file
Add Comment
Please, Sign In to add comment