Browse Source

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
closed-social-v3
Takeshi Umeda 3 years ago
committed by GitHub
parent
commit
25345c90ff
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      lib/mastodon/search_cli.rb

+ 3
- 1
lib/mastodon/search_cli.rb 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)

Loading…
Cancel
Save