Created
March 5, 2014 19:40
-
-
Save mjacobus/9374926 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ActiveRecord | |
module ConnectionAdapters | |
class ConnectionPool | |
class Queue | |
# Waits on the queue up to +timeout+ seconds, then removes and | |
# returns the head of the queue. | |
# def wait_poll(timeout) | |
# @num_waiting += 1 | |
# t0 = Time.now | |
# elapsed = 0 | |
# loop do | |
# @cond.wait(timeout - elapsed) | |
# return remove if any? | |
# elapsed = Time.now - t0 | |
# if elapsed >= timeout | |
# msg = 'could not obtain a database connection within %0.3f seconds (waited %0.3f seconds)' % | |
# [timeout, elapsed] | |
# raise ConnectionTimeoutError, msg | |
# end | |
# end | |
# ensure | |
# @num_waiting -= 1 | |
# end | |
# The original method is above. This is the "fix" | |
def wait_poll(timeout) | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment