it "has the jobs completed" do |example|
b = Sidekiq::Batch.new
b.jobs do
3.times {Sidekiq::Worker.perform_async(Time.now.to_i,nil)}
end
Sidekiq::Worker.perform_one
status = Sidekiq::Batch::Status.new(b.bid)
end
Here is my status output:
#<Sidekiq::Batch::Status:0x000000010c682808 @bid="4tR00OKDnnKWdA", @completed=0, @failures=0, @pending=3, @props={"created_at"=>"1675329197.732366", "callbacks"=>"{}", "pending"=>"3", "total"=>"3"}, @total=3>
For pending, it is still stuck at 3, where it should have been 2 from perform_one, where it will execute and finish the 1st job in the batch.
I have also used the flag stub_batches: false to use a real Sidekiq Worker to execute these dummy jobs.
May I know how is the Status for pending calculated?
Thank you!
Here is my block of code:
Here is my
status
output:#<Sidekiq::Batch::Status:0x000000010c682808 @bid="4tR00OKDnnKWdA", @completed=0, @failures=0, @pending=3, @props={"created_at"=>"1675329197.732366", "callbacks"=>"{}", "pending"=>"3", "total"=>"3"}, @total=3>
For pending, it is still stuck at 3, where it should have been 2 from
perform_one
, where it will execute and finish the 1st job in the batch.I have also used the flag
stub_batches: false
to use a real Sidekiq Worker to execute these dummy jobs. May I know how is the Status forpending
calculated? Thank you!