Files
gitlab-foss/lib/gitlab/redis/multi_store_connection_pool.rb
2024-08-16 09:12:07 +00:00

22 lines
491 B
Ruby

# frozen_string_literal: true
module Gitlab
module Redis
class MultiStoreConnectionPool < ::ConnectionPool
# We intercept the returned connection and borrow the connections
# before yielding the block.
def with
super do |conn|
next yield conn unless conn.respond_to?(:with_borrowed_connection)
conn.with_borrowed_connection do
yield conn
end
end
end
alias_method :then, :with
end
end
end