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
This commit is contained in:
Takeshi Umeda 2021-05-05 11:41:10 +09:00 committed by GitHub
parent 6930e22a7c
commit 7bcd4a83f8

View file

@ -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)