Skip to content

Instantly share code, notes, and snippets.

@Capncavedan
Created April 25, 2024 16:15
Show Gist options
  • Save Capncavedan/0518f4aafa737052bf6c86e726ba04d3 to your computer and use it in GitHub Desktop.
Save Capncavedan/0518f4aafa737052bf6c86e726ba04d3 to your computer and use it in GitHub Desktop.
Removing orphaned sidekiq-unique-jobs digests
> SidekiqUniqueJobs::LockDigest.new({
'class' => 'SidekiqQueuesMetricsWorker',
'queue' => 'system_critical',
'lock_args' => [],
}).lock_digest
# => ":c9e4f70a93ec7b29f57842219285f439"
> r = Redis.new
# => #<Redis client v4.8.1 for redis://hostname....
> r.keys.select { |k| k.start_with? 'uniquejobs:c9e4c9e4f70a93ec7b29f57842219285f439' }
# =>
# ["uniquejobs:c9e4f70a93ec7b29f57842219285f439",
# "uniquejobs:c9e4f70a93ec7b29f57842219285f439:QUEUED"]
> r.del "uniquejobs:c9e4f70a93ec7b29f57842219285f439:QUEUED"
# => 1
> r.del "uniquejobs:c9e4f70a93ec7b29f57842219285f439"
# => 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment