mirror of
https://gitlab.com/gitlab-org/gitlab-foss.git
synced 2025-07-29 12:00:32 +00:00
22 lines
491 B
Ruby
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
|