Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2017-02-06 19:01:56 +0300
committerLin Jen-Shin <godfat@godfat.org>2017-02-14 15:13:54 +0300
commit521a7cafd4226a03d7f0b5d35a2370559fb345cb (patch)
treea51030de18a34f55fe29b7b0054c273ef2048ce6 /db/post_migrate
parent887aeefba63429b6603c75e385148a2c6be34be1 (diff)
Try this way to provide database connection
Diffstat (limited to 'db/post_migrate')
-rw-r--r--db/post_migrate/20170206040400_remove_inactive_default_email_services.rb9
1 files changed, 3 insertions, 6 deletions
diff --git a/db/post_migrate/20170206040400_remove_inactive_default_email_services.rb b/db/post_migrate/20170206040400_remove_inactive_default_email_services.rb
index b107d9204d2..d69f68a13d2 100644
--- a/db/post_migrate/20170206040400_remove_inactive_default_email_services.rb
+++ b/db/post_migrate/20170206040400_remove_inactive_default_email_services.rb
@@ -31,13 +31,10 @@ class RemoveInactiveDefaultEmailServices < ActiveRecord::Migration
end
end
- def with_connection
+ def with_connection(&block)
pool = ActiveRecord::Base.establish_connection
- connection = pool.connection
-
- yield(connection)
-
+ pool.with_connection(&block)
ensure
- connection.close
+ pool.disconnect!
end
end