Reputation: 11659
Say I have a job that fires off in a separate thread like this:
TaxCalculator.perform_async({ user_id: user.id, description: 'test description', count: 1 })
Say the actual class is something like:
class TaxCalculator
def perform(args)
user = User.find(args['user_id'])
description = args['description']
#some stuff goes on here
end
end
Say the queue is quite long. Some things happen and perhaps code changes and deploys are made. When the job finally fires, what references are needed. If the class name changes to something else like to say Namespace::TaxCalculator
, will the job fail? What kind of reference is still in a Sidekiq job? the arguments? The id? The name of the class?
Upvotes: 1
Views: 355
Reputation: 317
With changes in your structure you can use old constant as a link to new, for example:
TaxCalculator = Namespace::TaxCalculator
... and with the next update you can remove this link because all the jobs was finished.
Upvotes: 4