diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2017-02-14 13:48:13 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2017-02-14 13:48:13 +0800 |
commit | 03f1abfcc3e43fce188f94a770f5f7b6af6f36b5 (patch) | |
tree | e7a9e73df4c99c1318acf94d18a936de00265b9c /lib | |
parent | 136dc79433295aded9ecabb15aae2dc1e228b903 (diff) | |
download | gitlab-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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/database.rb | 9 |
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) |