Mark Chavez
eat. sleep. repeat. 👾 coding, ⌨️ keyboarding, 🚴🏼 cycling.
Changing Sidekiq Job Arguments Safely 08/04/2023

By Sidekiq 7.0 you are not allowed to pass in a hash that use symbols as keys. For example:

# before 7.0; will raise an error/exception
SomeWorker.perform_async({ id: 5, name: "Mark" })

# version 7.0 and up; ✅ ✅ ✅
SomeWorker.perform_async({ "id" => 5, "name" => "Mark" })
Changing arguments of a Sidekiq worker
1. Make a new worker with the new argument signature
2. Point all code to use the new worker class
3. Deploy/Release version 1.0
4. Update the argument signature and logic of old worker
5. Deploy/Release version 1.1
6. Point all code to use the old worker class
7. Deploy/Release version 1.2
8. Remove new worker class

References: