Closed fatkodima closed 1 year ago
Sidekiq jobs are meant to be idempotent. Doesn't the requirement to store job execution state mean that the job is inherently not idempotent?
You could use middleware and store your data in Redis.
Thank you for the response!
You could use middleware and store your data in Redis.
This is the approach I was thinking originally to implement, but decided to go with the approach used in the original gem that this gem is based on - https://github.com/Shopify/job-iteration/blob/bd6e7aa28cf9030caa99f3bd0582f18fbf7e7873/lib/job-iteration/iteration.rb#L106-L112
I will revisit the approach if it will cause more problems down the road.
Sidekiq allows middleware to mutate the job payload for the current invocation but does not persist those changes. I guess that's your issue, you want to persist your mutations to the job payload?
I guess that's your issue, you want to persist your mutations to the job payload?
Yes.
Closes #1.
@mperham Can you please suggest how can I store some additional data to the job when it is retried without the need to override
process_retry
(see this PR changes)? Currently, sidekiq directly pushed the failed job to theretry
queue - https://github.com/mperham/sidekiq/blob/cc2a07d45e8621aaac886290d397968aa2bc2cb6/lib/sidekiq/job_retry.rb#L187-L189 Or I am missing something?