-
Notifications
You must be signed in to change notification settings - Fork 15
Closed
Milestone
Description
When Using a MaxRetry handler option for Queues and Queue Option argument is an empty hash, it throws an error.
name = "sample-max-retry"
opts[:queue_options] = {:durable=>true, :auto_delete=>false, :exclusive=>false, :arguments=>{}}
Sneakers::Handlers::Maxretry.configure_queue(
name,
opts
)
The line
kicks/lib/sneakers/handlers/maxretry.rb
Line 87 in 185b51c
| opt_args = opts[:queue_options][:arguments] ? opts[:queue_options][:arguments].inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo} : {} |
opts[:queue_options][:arguments] ? will return true and trying to inject and empty hash will raise an error.
Changing the line
opt_args = opts[:queue_options][:arguments] ? opts[:queue_options][:arguments].inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo} : {}
To
opt_args = opts[:queue_options][:arguments].blank? ? {} : opts[:queue_options][:arguments].inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
Should fix the issue.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels