Does the args filter need to return an array?
Or can it return any unique string (or object that responds to .hash, etc)?
For example would this work?
class SomeJob
include Sidekiq::Worker
sidekiq_options queue: :critical, unique: true, unique_args: :args_filter
def self.args_filter(*args)
args.first
end
def perform(object_id, attempts=1)
...
end
end
Second question: does args_filter need to include the name of the job ("SomeJob" in this case)? Or is this added for you?
The docs don't make it super clear because they shown an example like this (but don't show the corresponding perform method signature, so it's unclear what these variables are actually referring to.
def self.unique_args(name, id, options)
[ name, options[:type] ]
end
Thanks!
Does the args filter need to return an array?
Or can it return any unique string (or object that responds to .hash, etc)?
For example would this work?
Second question: does args_filter need to include the name of the job ("SomeJob" in this case)? Or is this added for you?
The docs don't make it super clear because they shown an example like this (but don't show the corresponding perform method signature, so it's unclear what these variables are actually referring to.
Thanks!