method
execute_or_wait
v8.0.0 -
Show latest stable
- Class:
ActiveRecord::FutureResult
execute_or_wait()private
No documentation available.
# File activerecord/lib/active_record/future_result.rb, line 144
def execute_or_wait
if pending?
start = Process.clock_gettime(Process::CLOCK_MONOTONIC, :float_millisecond)
@mutex.synchronize do
if pending?
@pool.with_connection do |connection|
execute_query(connection)
end
else
@lock_wait = (Process.clock_gettime(Process::CLOCK_MONOTONIC, :float_millisecond) - start)
end
end
else
@lock_wait = 0.0
end
end