Sha256: 5a8aedb8f21443a136e4c09c136537c489f1c560a0f784c1c041fc4e7dc6a777
Contents?: true
Size: 1.07 KB
Versions: 17
Compression:
Stored size: 1.07 KB
Contents
module ActiveRecord::Turntable module ActiveRecordExt module ConnectionHandlerExtension extend ActiveSupport::Concern included do alias_method_chain :pool_for, :turntable end private # @note Override not to establish_connection destroy existing connection pool proxy object def pool_for_with_turntable(owner) owner_to_pool.fetch(owner.name) { if ancestor_pool = pool_from_any_process_for(owner) if ancestor_pool.is_a?(ActiveRecord::ConnectionAdapters::ConnectionPool) # A connection was established in an ancestor process that must have # subsequently forked. We can't reuse the connection, but we can copy # the specification and establish a new connection with it. establish_connection owner, ancestor_pool.spec else # Use same PoolProxy object owner_to_pool[owner.name] = ancestor_pool end else owner_to_pool[owner.name] = nil end } end end end end
Version data entries
17 entries across 17 versions & 1 rubygems