Fix crash in tootctl
commands making use of parallelization when Elasticsearch is enabled (#24182)
This commit is contained in:
parent
2125dbf610
commit
f75fba0531
@ -53,6 +53,7 @@ module Mastodon
|
||||
|
||||
progress.log("Processing #{item.id}") if options[:verbose]
|
||||
|
||||
Chewy.strategy(:mastodon) do
|
||||
result = ActiveRecord::Base.connection_pool.with_connection do
|
||||
yield(item)
|
||||
ensure
|
||||
@ -61,6 +62,7 @@ module Mastodon
|
||||
end
|
||||
|
||||
aggregate.increment(result) if result.is_a?(Integer)
|
||||
end
|
||||
rescue => e
|
||||
progress.log pastel.red("Error processing #{item.id}: #{e}")
|
||||
ensure
|
||||
|
Loading…
Reference in New Issue
Block a user