diff options
author | abcang <abcang1015@gmail.com> | 2021-04-01 00:46:17 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-31 17:46:17 +0200 |
commit | ddabbbf5a652c4dc5504477d979fd44cc570e7a6 (patch) | |
tree | 1843db009d6040ae287711db47946a79a24821d2 | |
parent | f5bcc6bc65dee332542195e807ecff446cea0ae4 (diff) |
Fix DB connection pool settings in CLI (#15983)
-rw-r--r-- | lib/mastodon/cli_helper.rb | 4 |
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]) |