consider the following worker:
class CustomWorker
include Sidekiq::Worker
sidekiq_options unique: :until_executed
unique_args: :custom_args
def self.custom_args
puts 'testing'
end
def perform(optional=nil)
end
end
running CustomWorker.perform_async will not run custom_args method and will not print 'testing'
But running CustomWorker.perform_async(nil), CustomWorker.perform_async(2) works as expected.
ruby 2.1.8
gem 'sidekiq', '3.5.4'
gem 'sidekiq-cron', '0.3.1'
gem 'sidekiq-failures', '0.4.5'
gem 'sidekiq-unique-jobs', '4.0.18'
gem 'sidekiq_status', git: 'https://github.com/cryo28/sidekiq_status' (1.2.0)
consider the following worker:
running
CustomWorker.perform_asyncwill not runcustom_argsmethod and will not print 'testing'But running
CustomWorker.perform_async(nil),CustomWorker.perform_async(2)works as expected.ruby 2.1.8
gem 'sidekiq', '3.5.4'
gem 'sidekiq-cron', '0.3.1'
gem 'sidekiq-failures', '0.4.5'
gem 'sidekiq-unique-jobs', '4.0.18'
gem 'sidekiq_status', git: 'https://github.com/cryo28/sidekiq_status' (1.2.0)