summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2017-02-14 13:48:13 +0800
committerLin Jen-Shin <godfat@godfat.org>2017-02-14 13:48:13 +0800
commit03f1abfcc3e43fce188f94a770f5f7b6af6f36b5 (patch)
treee7a9e73df4c99c1318acf94d18a936de00265b9c
parent136dc79433295aded9ecabb15aae2dc1e228b903 (diff)
downloadgitlab-ce-03f1abfcc3e43fce188f94a770f5f7b6af6f36b5.tar.gz
Only ensure against yield so that pool should be availablecreate-connection-pool
Feedback: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/9192#note_23293693
-rw-r--r--lib/gitlab/database.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/gitlab/database.rb b/lib/gitlab/database.rb
index e6612bc3aad..a6e9ea3dead 100644
--- a/lib/gitlab/database.rb
+++ b/lib/gitlab/database.rb
@@ -72,10 +72,11 @@ module Gitlab
def self.with_connection_pool(pool_size)
pool = create_connection_pool(pool_size)
- yield(pool)
-
- ensure
- pool.disconnect!
+ begin
+ yield(pool)
+ ensure
+ pool.disconnect!
+ end
end
def self.create_connection_pool(pool_size)