Skip to content

Commit

Permalink
Fix DB connection pool settings in CLI (mastodon#15983)
Browse files Browse the repository at this point in the history
  • Loading branch information
abcang authored and starfall-system committed Apr 11, 2021
1 parent 8cf1cba commit 21ec46b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/mastodon/cli_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ def parallelize_with_progress(scope)
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])
Expand Down

0 comments on commit 21ec46b

Please sign in to comment.