Commit 03f1abfc authored by Lin Jen-Shin's avatar Lin Jen-Shin

Only ensure against yield so that pool should be available

Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/9192#note_23293693
parent 136dc794
...@@ -72,10 +72,11 @@ module Gitlab ...@@ -72,10 +72,11 @@ module Gitlab
def self.with_connection_pool(pool_size) def self.with_connection_pool(pool_size)
pool = create_connection_pool(pool_size) pool = create_connection_pool(pool_size)
yield(pool) begin
yield(pool)
ensure ensure
pool.disconnect! pool.disconnect!
end
end end
def self.create_connection_pool(pool_size) def self.create_connection_pool(pool_size)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment