README.md in sidekiq-unique-jobs-4.0.8 vs README.md in sidekiq-unique-jobs-4.0.9

- old
+ new

@@ -26,15 +26,15 @@ Or install it yourself as: $ gem install sidekiq-unique-jobs -## A word on locking +## Locking -Like @mperham mentions on [this wiki page](https://github.com/mperham/sidekiq/wiki/Related-Projects#unique-jobs) it is hard to enforce uniqueness with redis in a distributed redis setting. +Like @mperham mentions on [this wiki page](https://github.com/mperham/sidekiq/wiki/Related-Projects#unique-jobs) it is hard to enforce uniqueness with redis in a distributed redis setting. -To make things worse there are many ways of wanting to enforce uniqueness. +To make things worse there are many ways of wanting to enforce uniqueness. ### While Executing Due to discoverability of the different lock types `unique` sidekiq option it was decided to use the `while_executing` as a default. Most people will note that scheduling any number of jobs with the same arguments is possible. @@ -72,11 +72,11 @@ ```ruby sidekiq_options unique: :until_and_while_executing ``` -This lock is exactly what you would expect. It is considered unique in a way until executing begins and it is locked while executing so what differs from `UntilExecuted`? +This lock is exactly what you would expect. It is considered unique in a way until executing begins and it is locked while executing so what differs from `UntilExecuted`? The difference is that this job has two types of uniqueness: 1. It is unique until execution 2. It is unique while executing @@ -185,10 +185,27 @@ ... end ``` -### Testing +## Debugging +There are two ways to display and remove keys regarding uniqueness. The console way and the command line way. + +### Console +Start the console with the following command `bundle exec jobs console`. + +#### List Unique Keys +`keys '*', count: 100` + +#### Remove Unique Keys +`del_by '*', count: 100, dry_run: false` the dry_run and count parameters are both required. This is to have some type of protection against clearing out all uniqueness. + +### Command Line + +`bundle exec jobs` displays help on how to use the unique jobs command line. + + +## Testing To enable the testing for `sidekiq-unique-jobs`, add `require 'sidekiq_unique_jobs/testing'` to your testing helper. ## Contributing