Skip to content

Commit

Permalink
Minor Bug Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
richseviora committed Nov 25, 2016
1 parent 2f6881b commit c127660
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/shoryuken/queue.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ def sanitize_messages!(options)
options = case
when options.is_a?(Array)
{ entries: options.map.with_index do |m, index|
{ id: index.to_s }.merge(m.is_a?(Hash) ? m : { message_body: m }).tap(&method(:add_fifo_attributes))
{ id: index.to_s }.merge(m.is_a?(Hash) ? m : { message_body: m }).tap(&method(:add_fifo_attributes!))
end }
when options.is_a?(Hash)
options[:entries].each(&:add_fifo_attributes!)
options[:entries].each(&method(:add_fifo_attributes!))
options
end
validate_messages!(options)
Expand All @@ -83,6 +83,8 @@ def add_fifo_attributes!(message_hash)

message_hash[:message_group_id] = MESSAGE_GROUP_ID
message_hash[:message_deduplication_id] = SecureRandom.uuid unless has_content_deduplication?

message_hash
end

def sanitize_message!(options)
Expand Down

0 comments on commit c127660

Please sign in to comment.