Update progress_helper.rb

This commit is contained in:
Shlee 2025-12-13 19:56:05 +10:30 committed by GitHub
parent 759f53b3d2
commit c8a5a176de
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -51,8 +51,13 @@ module Mastodon::CLI
result = ActiveRecord::Base.connection_pool.with_connection do
yield(item)
ensure
RedisConnection.pool.checkin if Thread.current[:redis]
Thread.current[:redis] = nil
begin
RedisConnection.pool.checkin if Thread.current[:redis]
rescue ConnectionPool::Error
nil
ensure
Thread.current[:redis] = nil
end
end
aggregate.increment(result) if result.is_a?(Integer)