cryo28 / sidekiq_status

Extension to Sidekiq to pass job execution metadata such as status and result back to the client
MIT License
152 stars 53 forks source link

Use Sidekiq::Worker#jid instead of replacing job arguments with jid generated by SidekiqStatus #31

Closed cryo28 closed 8 years ago

cryo28 commented 8 years ago

When SidekiqStatus was developed, sidekiq did not support the notion of jid - so the result value of Sidekiq::Worker.perform_async was a truthy/falsey value, not a unique jid.

Because of that SidekiqStatus had to introduce that and massage job arguments back and forth.

Nowadays, sidekiq generates jid for each individual job on its own and Sidekiq::Processor ensures that Sidekiq::Worker#jid attr_reader is assigned to the jid of the currently processing job.

Because of that, there is no need for SidekiqStatus to do this arguments massaging anymore.

This commit removes this argument massaging and relies of Sidekiq::Processor to setup Sidekiq::Worker#j anymore.

This commit removes this argument massaging and relies of Sidekiq::Processor to setup Sidekiq::Worker#jid

Hopefully this change should simplify the code need to make SidekiqStatus work together with retry jobs middleware and sidekiq_unique_jobs (pending)