Let's say we have 100 objects to send in Sidekiq to process some data. A rake is written which runs every 24 hours and picks up all 100 object where the object has column sidekiq_processed as false and send it into Sidekiq queue for processing. After Sidekiq has processed data sidekiq_processed column of the object is updated as true so that next time when the rake is scheduled that object is not picked up.
The problem I'm facing is some objects after say 20 days still have sidekiq_processed as false. I have also implemented logging inside perform function to note each event/state in which my objects are.
Let's say there were 20 objects left which didn't get processed. Their logs were checked and no logs of these objects were found. After triggering new.perform on the 21st day all objects were finally processed.
I don't want to trigger them manually is there a way we could check why Sidekiq didn't consume my queue objects.
task :process_some_objects => :environment do
Object.where(sidekiq_processed: false).each do |object|
Worker.perform_async(object.id)
end
end