Class: Gitlab::Redis::MultiStoreConnectionPool

Inherits:
ConnectionPool
  • Object
show all
Defined in:
lib/gitlab/redis/multi_store_connection_pool.rb

Instance Method Summary collapse

Instance Method Details

#withObject Also known as: then

We intercept the returned connection and borrow the connections before yielding the block.



8
9
10
11
12
13
14
15
16
# File 'lib/gitlab/redis/multi_store_connection_pool.rb', line 8

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