]> cat aescling's git repositories - mastodon.git/commitdiff
Fix DB connection pool settings in CLI (#15983)
authorabcang <abcang1015@gmail.com>
Wed, 31 Mar 2021 15:46:17 +0000 (00:46 +0900)
committerGitHub <noreply@github.com>
Wed, 31 Mar 2021 15:46:17 +0000 (17:46 +0200)
lib/mastodon/cli_helper.rb

index ed22f44b2bfd0b09222312a82e4453cd80d3a032..aaee1fa91132c2e79061a153242938062293e0e3 100644 (file)
@@ -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])