Improve "batch-died" autoclean
Author: mperhamCreated Sep 17, 2026Updated Sep 17, 2026
Every death callback fires S::Batch::DeadSet#clean. This is not a problem if you have a few dead batches but becomes cumbersome if the user has lots of dead batches for some reason. The more you use batches, the worse the performance gets.
- Put an hourly throttle on the operation so we don't try to clean more often than once per hour.
- Sidekiq Pro 9.0 should increase the Redis requirement to >=7.4 which allows us to use expiring hash fields. We should migrate the current Set to a Hash where each BID member is a Hash field with an expiry matching the batch's expiry.
Source: sidekiq/sidekiq