Skip to content

Commit 644e503

Browse files
abcangchrisguida
authored andcommitted
Fix DB connection pool settings in CLI (mastodon#15983)
1 parent 931b3f0 commit 644e503

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/mastodon/cli_helper.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ def parallelize_with_progress(scope)
2525
exit(1)
2626
end
2727

28-
ActiveRecord::Base.configurations[Rails.env]['pool'] = options[:concurrency] + 1
28+
db_config = ActiveRecord::Base.configurations[Rails.env].dup
29+
db_config['pool'] = options[:concurrency] + 1
30+
ActiveRecord::Base.establish_connection(db_config)
2931

3032
progress = create_progress_bar(scope.count)
3133
pool = Concurrent::FixedThreadPool.new(options[:concurrency])

0 commit comments

Comments
 (0)