about summary refs log tree commit diff
path: root/lib/mastodon
diff options
context:
space:
mode:
authorTakeshi Umeda <noel.yoshiba@gmail.com>2021-05-05 11:41:10 +0900
committerGitHub <noreply@github.com>2021-05-05 04:41:10 +0200
commit25345c90ffb74a8231eae4a130c98b6eaad7ce36 (patch)
tree604f9feba10e6592fb48682636d563969cf07099 /lib/mastodon
parent19d3809ad5ca2299216e4b7793c39cc357b2b676 (diff)
Fix how to change connection pool for rails 6 (#16158)
* Fix how to change connection pool for rails 6

* Fix to match the code elsewhere
Diffstat (limited to 'lib/mastodon')
-rw-r--r--lib/mastodon/search_cli.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/mastodon/search_cli.rb b/lib/mastodon/search_cli.rb
index 22a0acec8..c0491744b 100644
--- a/lib/mastodon/search_cli.rb
+++ b/lib/mastodon/search_cli.rb
@@ -53,7 +53,9 @@ module Mastodon
         index.specification.lock!
       end
 
-      ActiveRecord::Base.configurations[Rails.env]['pool'] = options[:concurrency] + 1
+      db_config = ActiveRecord::Base.configurations[Rails.env].dup
+      db_config['pool'] = options[:concurrency] + 1
+      ActiveRecord::Base.establish_connection(db_config)
 
       pool    = Concurrent::FixedThreadPool.new(options[:concurrency])
       added   = Concurrent::AtomicFixnum.new(0)