about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorabcang <abcang1015@gmail.com>2021-04-01 00:46:17 +0900
committerStarfall <us@starfall.systems>2021-04-11 12:17:56 -0500
commit21ec46b2acbadfdf7fb14d1f76bb60ce25c8f69f (patch)
treef71aa078191cada0154661383c42fc71ad11d9bc /lib
parent8cf1cbadf7a88be1797daab8bcf15be7a5c7130b (diff)
Fix DB connection pool settings in CLI (#15983)
Diffstat (limited to 'lib')
-rw-r--r--lib/mastodon/cli_helper.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/mastodon/cli_helper.rb b/lib/mastodon/cli_helper.rb
index ed22f44b2..aaee1fa91 100644
--- a/lib/mastodon/cli_helper.rb
+++ b/lib/mastodon/cli_helper.rb
@@ -25,7 +25,9 @@ module Mastodon
         exit(1)
       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)
 
       progress  = create_progress_bar(scope.count)
       pool      = Concurrent::FixedThreadPool.new(options[:concurrency])