Browse Source

Fix DB connection pool settings in CLI (#15983)

closed-social-v3
abcang 3 years ago
committed by GitHub
parent
commit
ddabbbf5a6
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/cli_helper.rb

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

Loading…
Cancel
Save