Fix crash in `tootctl` commands making use of parallelization when Elasticsearch is enabled (#24182)

main^2
Claire 2 years ago committed by GitHub
parent 0ca54a4105
commit bdeb6ff180
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -52,6 +52,7 @@ module Mastodon
progress.log("Processing #{item.id}") if options[:verbose] progress.log("Processing #{item.id}") if options[:verbose]
Chewy.strategy(:mastodon) do
result = ActiveRecord::Base.connection_pool.with_connection do result = ActiveRecord::Base.connection_pool.with_connection do
yield(item) yield(item)
ensure ensure
@ -60,6 +61,7 @@ module Mastodon
end end
aggregate.increment(result) if result.is_a?(Integer) aggregate.increment(result) if result.is_a?(Integer)
end
rescue => e rescue => e
progress.log pastel.red("Error processing #{item.id}: #{e}") progress.log pastel.red("Error processing #{item.id}: #{e}")
ensure ensure

Loading…
Cancel
Save