-
-
Notifications
You must be signed in to change notification settings - Fork 276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Version 4 Upgrade #133
Comments
If you state your needs I might be able to help you. Can you post the workers and the job hash from sidekiq so that I can see if there is an easy upgrade path I could develop for you? |
Here's one example worker. ChargeWorker.perform_in(Settings.charge_retry_days.days, @object.id, retry_random: rand.to_s) class ChargeWorker < BaseWorker
sidekiq_options queue: :charge,
unique: :until_executed
def perform(id, _options = {})
ApplyCharge.call(id: id)
end
end We have other workers too, but this is one example. Thanks so much for your help. |
Ok so first things first! You job will always be unique because the arguments is using some type of random but maybe that is ok? I also don't see what your job configuration was previously which would be helpful to understand what is needed. |
The only difference is |
First of all the job will always be unique, not sure if you are aware of that? |
Yea I understand that :) thats how it was intended due to |
But you could as well not have it unique over that random thing. Every job with the id will be unique. |
When the charge is processed for the first time i.e when job queued for the first time then we only use - |
What did the worker look like before? I am trying to understand what the job hash looks like in redis. |
This is what it looks like right now - class ChargeWorker < BaseWorker
sidekiq_options queue: :charge,
unique: true
def perform(id, _options = {})
ApplyCharge.call(id: id)
end
end |
From what I can gather the example job should be upgraded automagically. Just make sure that the ApplyCharge class is protecting against actually applying charges by id more than once. I can only guarantee certain types of uniqueness most of them constrained to 1 hour maximum. |
Got it. Thanks for your inputs and your work on this gem. |
Little confused about the upgrade -- difference between Easy path & Hard path? We have many future (unique) jobs scheduled, do both upgrade paths require us to delete jobs?
If we just upgrade the code and dont delete the jobs, would things just work?
The text was updated successfully, but these errors were encountered: