breamware / sidekiq-batch

Sidekiq Batch Jobs Implementation
MIT License
357 stars 95 forks source link

Question about status on callbacks #17

Closed PedroSena closed 4 years ago

PedroSena commented 6 years ago

Hi,

I'm starting with sidekiq-batch and I'd like to know if the result I'm getting is really expected/intended:

Whenever I finish a job batch when I see the status object that I receive both on on_success and on_complete I see they always have empty values when everything works as it should. {:total=>0, :failures=>0, :pending=>0, :created_at=>nil, :complete=>false, :failure_info=>[], :parent_bid=>nil} This is one example from a Batch that had a single job that was executed successfully. I was expecting to see total 1 and complete true but that didn't happen.

Whenever I have a batch containing one job that failed I see the info correctly set though.

Is this really intended ? Because I was expecting to be able to log such information on database upon completion but apparently I can't rely on this object I receive on the callback.

Thanks

Jay-Plumb commented 6 years ago

@PedroSena are you on sidekiq 5.x.x? I have noticed issues with this gem with regards to the callbacks when upgrading from sidekiq 4.x.x to 5.x.x.

PedroSena commented 6 years ago

@Jay-Plumb Yes, Ruby 2.3.4 and Rails 5.1.4. Good to know I'm not the only one, thanks Jay

djgould commented 5 years ago

I'm having this issue as well. Although it's seems intended (the redis keys are explicity being deleted on success). I'm not sure if this is the best idea. I'd like to know what happened during a batch after it is completed. Any thoughts?

EddFigueiredo commented 5 years ago

I just started to use this gem, and i'm having the same behavior here. I'm on sidekip 4.2.0 rails 4.2.11 and ruby 2.3.6

lucasdavila commented 5 years ago

+1 It looks like the status isn't being updated for the batch.

github-actions[bot] commented 4 years ago

Stale issue message