Skip to content

Commit

Permalink
Update docs (#644)
Browse files Browse the repository at this point in the history
* Fix typo of gemspec

* Update method doc reflected new data structure

* Use ruby method to convert to hash
  • Loading branch information
ruzig authored Oct 8, 2021
1 parent fb481ed commit 3482c82
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 3 additions & 6 deletions lib/sidekiq_unique_jobs/digests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ def add(digest)
#
# @param [String] pattern a key pattern to match with
# @param [Integer] count the maximum number
# @return [Array<String>] with unique digests
# @return [Hash<String,Float>] Hash mapping of digest matching the given pattern and score

def delete_by_pattern(pattern, count: DEFAULT_COUNT)
result, elapsed = timed do
digests = entries(pattern: pattern, count: count).keys
Expand Down Expand Up @@ -80,11 +81,7 @@ def entries(pattern: SCAN_PATTERN, count: DEFAULT_COUNT)
options[:match] = pattern
options[:count] = count

result = redis { |conn| conn.zscan_each(key, **options).to_a }

result.each_with_object({}) do |entry, hash|
hash[entry[0]] = entry[1]
end
redis { |conn| conn.zscan_each(key, **options).to_a }.to_h
end

#
Expand Down
2 changes: 1 addition & 1 deletion sidekiq-unique-jobs.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
spec.post_install_message = <<~POST_INSTALL
IMPORTANT!
Automatic configuration of the sidekiq middelware is no longer done.
Automatic configuration of the sidekiq middleware is no longer done.
Please see: https://github.com/mhenrixon/sidekiq-unique-jobs/blob/master/README.md#add-the-middleware
This version deprecated the following sidekiq_options
Expand Down

0 comments on commit 3482c82

Please sign in to comment.