Guest User

Untitled

a guest
Jun 21st, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.51 KB | None | 0 0
  1. 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
  2. index aac84cc..cadedd4 100644
  3. --- a/shared/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
  4. +++ b/shared/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
  5. @@ -180,6 +180,7 @@ module ActiveRecord
  6. # within the timeout period.
  7. def checkout
  8. # Checkout an available connection
  9. + Rails.logger.info "***DBFUCK***Attempting to check out a connection. #{caller.inspect}"
  10. @connection_mutex.synchronize do
  11. loop do
  12. conn = if @checked_out.size < @connections.size
  13. @@ -188,8 +189,10 @@ module ActiveRecord
  14. checkout_new_connection
  15. end
  16. return conn if conn
  17. + Rails.logger.info "***DBFUCK***No connections available in pool, and too full"
  18. # No connections available; wait for one
  19. if @queue.wait(@timeout)
  20. + Rails.logger.info "***DBFUCK***waited, trying again."
  21. next
  22. else
  23. # try looting dead threads
  24. @@ -242,20 +245,24 @@ module ActiveRecord
  25. end
  26.  
  27. def checkout_new_connection
  28. + Rails.logger.info "***DBFUCK***Checking out a new connection"
  29. c = new_connection
  30. @connections << c
  31. checkout_and_verify(c)
  32. end
  33.  
  34. def checkout_existing_connection
  35. + Rails.logger.info "***DBFUCK***Checking out an existing connection"
  36. c = (@connections - @checked_out).first
  37. checkout_and_verify(c)
  38. end
  39.  
  40. def checkout_and_verify(c)
  41. + Rails.logger.info "***DBFUCK***Verifying it"
  42. c.verify!
  43. c.run_callbacks :checkout
  44. @checked_out << c
  45. + Rails.logger.info "***DBFUCK***Checked out!"
  46. c
  47. end
  48. end
  49. diff --git a/store/config/environments/production.rb b/store/config/environments/production.rb
  50. index 8dc2ea0..48fd80b 100644
  51. --- a/store/config/environments/production.rb
  52. +++ b/store/config/environments/production.rb
  53. @@ -33,4 +33,6 @@ config.after_initialize do
  54. ActionController::Base.session_options[:domain] = '.pragprog.com'
  55. ActionMailer::Base.logger = nil
  56. IcontactSync.enabled = true
  57. -end
  58. \ No newline at end of file
  59. +end
  60. +
  61. +config.log_level = :debug
  62. \ No newline at end of file
Add Comment
Please, Sign In to add comment