Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow sqs create FIFO queues #419

Merged
merged 9 commits into from
Jul 30, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions bin/cli/sqs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ def dump_file(path, queue_name)
end

desc 'ls [QUEUE-NAME-PREFIX]', 'Lists queues'
method_option :watch, aliases: '-w', type: :boolean, desc: 'watch queues'
method_option :watch_interval, type: :numeric, default: 10, desc: 'watch interval'
method_option :watch, aliases: '-w', type: :boolean, desc: 'watch queues'
method_option :interval, aliases: '-n', type: :numeric, default: 2, desc: 'watch interval in seconds'
def ls(queue_name_prefix = '')
trap('SIGINT', 'EXIT') # expect ctrl-c from loop

Expand All @@ -108,7 +108,7 @@ def ls(queue_name_prefix = '')

break unless options[:watch]

sleep options[:watch_interval]
sleep options[:interval]
puts
end
end
Expand Down Expand Up @@ -187,8 +187,12 @@ def purge(queue_name)
end

desc 'create QUEUE-NAME', 'Create a queue'
method_option :attributes, aliases: '-a', type: :hash, default: {}, desc: 'queue attributes'
def create(queue_name)
queue_url = sqs.create_queue(queue_name: queue_name).queue_url
attributes = options[:attributes]
attributes['FifoQueue'] ||= 'true' if queue_name.end_with?('.fifo')

queue_url = sqs.create_queue(queue_name: queue_name, attributes: attributes).queue_url

say "Queue #{queue_name} was successfully created. Queue URL #{queue_url}", :green
end
Expand Down
2 changes: 1 addition & 1 deletion bin/shoryuken
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module Shoryuken
opts = options.to_h.symbolize_keys

if opts[:config_file]
say "[DEPRECATED] Please use --config instead of --config-file", :yellow
say '[DEPRECATED] Please use --config instead of --config-file', :yellow
end

opts[:config_file] = opts.delete(:config) if opts[:config]
Expand Down