Sidekiq middleware
Duplicate jobs, prevented.
sidekiq-unique-jobs stops the same job from being enqueued twice or run concurrently. Pick a lock type, pick what happens on a conflict, and let Redis keep your jobs unique.
gem "sidekiq-unique-jobs", "~> 9.0"From debouncing enqueues to serializing execution — choose the lock that matches the guarantee you need.
Log, raise, reject, replace, or reschedule when a duplicate shows up. Different rules for enqueue and execute.
v9 is a ground-up rewrite: a LOCKED hash and a global digests sorted set. Less memory, fewer moving parts.
A reaper cleans up locks left behind by crashed processes, so a hard kill never wedges a digest forever.
Reflection hooks fire on every lock event — wire them into your metrics and logs without patching the gem.
A Locks tab in the Sidekiq Web UI to browse, filter, and delete locks when you need to see what's held.
Documentation
- Overview
- Installation
- Quick start
- How locking works
- Lock lifecycle
- Choosing a lock type
- Conflict resolution
- TTL and timeouts
- ReliableFetch
- Orphaned locks and recovery
- Observability
- Debounce duplicate enqueues
- Process exactly once
- One per period
- Serialize per resource
- Enqueue once, run serialized
- Only the latest matters
- Retry conflicts later
- Bounded concurrency
- Custom uniqueness arguments
- Testing unique jobs
- Upgrading to v9
- Configuration reference
- Worker options
- Reflections
- Web UI