mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-20 03:25:17 +01:00
Fix crash in tootctl
commands making use of parallelization when Elasticsearch is enabled (#24182)
This commit is contained in:
parent
ab85f59c30
commit
3c82c4e780
@ -53,6 +53,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
|
||||||
@ -61,6 +62,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…
Reference in New Issue
Block a user