Reference

Configuration reference

Every global option you can set in a SidekiqUniqueJobs.configure block, grouped by concern.

The configure block#

Set global defaults once, at boot.

Global configuration lives in a SidekiqUniqueJobs.configure block — typically in your Sidekiq initializer, alongside the middleware. Every value here is a default: a worker's own sidekiq_options always wins over the global setting. For the per-worker keys, see Worker options.

# config/initializers/sidekiq.rb
SidekiqUniqueJobs.configure do |config|
  config.enabled          = true
  config.lock_ttl         = nil     # locks don't expire on their own
  config.lock_timeout     = 0       # fail fast when a lock is held
  config.lock_prefix      = "uniquejobs"
  config.on_conflict      = nil     # defer to each worker's on_conflict
  config.reaper           = :ruby   # safe orphan cleanup
  config.reaper_count     = 1000
  config.reaper_interval  = 600
  config.digest_algorithm = :legacy
end

The tables below list every option, its type, its default, and what it controls. They are generated from the gem's real config struct and drift-tested against it, so a renamed or added option fails the build until this reference is updated.

Locking#

OptionTypeDefaultDescription
enabledBooleantrueMaster switch. Set false to disable uniqueness globally (e.g. in tests).
lock_ttlInteger, nilnilDefault lock expiration in seconds; nil means the lock never expires on its own.
lock_timeoutInteger0Default seconds to wait for a contended lock; 0 means don't wait (fail fast).
lock_prefixString"uniquejobs"Prefix for every Redis lock key.
lock_infoBooleanfalseStore extra lock metadata (worker, args, timestamp) for debugging. Adds overhead.
on_conflictSymbol, Hash, nilnilGlobal default conflict strategy when a worker doesn't set its own; nil defers entirely to per-worker config.

Reaper (orphan cleanup)#

OptionTypeDefaultDescription
reaperSymbol, Boolean:rubyOrphan-lock reaper mode: :ruby (default, safe), :lua (faster, briefly blocks Redis), or :none/false to disable.
reaper_countInteger1000Maximum orphaned locks reaped per cycle. Keep low (≤1000) with the :lua reaper.
reaper_intervalInteger600Seconds between reaper runs (default 10 minutes).
reaper_timeoutInteger10Maximum seconds a single reaper run may take before it stops.
reaper_resurrector_intervalInteger3600Seconds between checks that the reaper thread is still alive (default 1 hour).
reaper_resurrector_enabledBooleanfalseRestart the reaper thread if it dies. Off by default.

Digest & storage#

OptionTypeDefaultDescription
digest_algorithmSymbol:legacyHow the uniqueness digest is hashed: :legacy (MD5) or :modern (FIPS-compatible). Changing this changes every digest.
max_historyInteger1000Number of changelog history entries retained.

Execution & errors#

OptionTypeDefaultDescription
locksmith_executorExecutor, nilnilConcurrent-Ruby executor for Locksmith promises; nil lazily builds a bounded default pool (prevents unbounded thread growth).
raise_on_config_errorBooleanfalseRaise instead of warn when a worker declares an invalid lock configuration.
logger_enabledBooleantrueEnable the gem's internal logging.
debug_luaBooleanfalseLog Lua script execution. Slow — for debugging only.