Skip to content

Commit

Permalink
Retrieve replica pool without checking out a connection
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuscruz committed Dec 24, 2024
1 parent f4d8188 commit 2c746c2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/active_record_proxy_adapters/primary_replica_proxy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ def initialize(primary_connection)

attr_reader :primary_connection, :last_write_at, :active_record_context

delegate :connected_to_stack, to: :connection_class
delegate :connection_handler, :connected_to_stack, to: :connection_class
delegate :reading_role, :writing_role, to: :active_record_context

def replica_pool
connection_class.connected_to(role: reading_role) { connection_class.connection_pool }
connection_handler.retrieve_connection_pool(connection_class.name, role: reading_role)
end

def connection_class
Expand Down

0 comments on commit 2c746c2

Please sign in to comment.