Reputation: 165
Can I rename a Sidekiq worker and deploy it in one step without worrying about jobs getting orphaned looking for the previous name? Or do I need to do a 2-step deploy to make sure the original jobs have drained from the queue before deleting the original worker?
For example, if I wanted to rename EmailSignupWorker
to EmailRegistrationWorker
, do I neeed to:
EmailRegistrationWorker
with the same contents as EmailSignupWorker
and use that new worker for all instances where EmailSignupWorker
was being used.EmailSignupWorker
jobs to drain.EmailSignupWorker
.Upvotes: 10
Views: 1545
Reputation: 22228
It is not safe. You can do this:
class A
end
B = A
to alias B to A instead of copying the code.
Upvotes: 11