lib/sidekiq_fast_debounce/utils.rb
def debounce_key(_klass, job, deb_opts = {})
        return deb_opts[:debounce_key] if deb_opts.key?(:debounce_key)
        raise ArgumentError, 'No way to determine debounce key' if job['args'].empty?

        if job['args'].length == 1
          job['args'].first
        else
          Digest::MD5.hexdigest(job['args'].to_json)
        end
      end
# Get the options for debounced Sidekiq job
# @param klass [Class] Sidekiq worker class
# @param job [Hash] hash that represents a Sidekiq job
# @param deb_opts [Hash] debounce specific options
# @return [String] key to use for this job
Get the options for debounced Sidekiq job
Get the options for debounced Sidekiq job
def debounce_key(_klass, job, deb_opts = {})
        return deb_opts[:debounce_key] if deb_opts.key?(:debounce_key)
        raise ArgumentError, 'No way to determine debounce key' if job['args'].empty?
        if job['args'].length == 1
          job['args'].first
        else
          Digest::MD5.hexdigest(job['args'].to_json)
        end
      end
def debounce_key ( _klass , job , deb_opts = { } ) return deb_opts [ :debounce_key ] if deb_opts . key? ( :debounce_key ) raise ArgumentError , 'No way to determine debounce key' if job [ 'args' ] . empty? if job [ 'args' ] . length == 1 job [ 'args' ] . first else Digest :: MD5 . hexdigest ( job [ 'args' ] . to_json ) end end
Get the options for debounced Sidekiq job
Get the options for debounced Sidekiq job
key to use for this job
key to use for this job
String
_klass
job
hash that represents a Sidekiq job
hash that represents a Sidekiq job
deb_opts
debounce specific options
debounce specific options
klass
Sidekiq worker class
Sidekiq worker class