Skip to content
Snippets Groups Projects
Commit 3c82c4e7 authored by Claire's avatar Claire
Browse files

Fix crash in `tootctl` commands making use of parallelization when...

Fix crash in `tootctl` commands making use of parallelization when Elasticsearch is enabled (#24182)
parent ab85f59c
No related branches found
No related tags found
No related merge requests found
......@@ -53,14 +53,16 @@ module Mastodon
progress.log("Processing #{item.id}") if options[:verbose]
result = ActiveRecord::Base.connection_pool.with_connection do
yield(item)
ensure
RedisConfiguration.pool.checkin if Thread.current[:redis]
Thread.current[:redis] = nil
Chewy.strategy(:mastodon) do
result = ActiveRecord::Base.connection_pool.with_connection do
yield(item)
ensure
RedisConfiguration.pool.checkin if Thread.current[:redis]
Thread.current[:redis] = nil
end
aggregate.increment(result) if result.is_a?(Integer)
end
aggregate.increment(result) if result.is_a?(Integer)
rescue => e
progress.log pastel.red("Error processing #{item.id}: #{e}")
ensure
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment