shoryuken 3.0.10 → 3.0.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f2752ef1274a4cb9472e72ed03d3adb4cf46cf4d
4
- data.tar.gz: b315676bbb72adccc1a56dc53802bf6424a7cdcc
3
+ metadata.gz: 245e3ba81adf78f01166faec0e8677ad325158c4
4
+ data.tar.gz: e6742defd6bf3b887783345ff4c282680c6e2ca0
5
5
  SHA512:
6
- metadata.gz: 1a6787690a9091caca28c4752bfc6b1e8677efa6de95526ce293f23bba7a8b7679cccb2f8b87ce2197903c91e2d6c6d0ad85132d293574ceebc2b724854a1669
7
- data.tar.gz: f08a4ef55637bf7fafda4efb8900a3f9e93c7f6f36e1b78ace4072df8e336e12e03f3789aebaceb7c91663da52386df2bba7b6f15afb16bbfc1e44055e842521
6
+ metadata.gz: ceb8790cd3b3ddc61ea36d09367e05cb42e5f195b90870e64642d1728ced6c2b94a5bb4d402db51b15da59c5db2f12852a1cc604ebf7fd6ac32259d8c71ab8f4
7
+ data.tar.gz: f26dc1d67b5f9a7093cd97640bd7fccea45fdfd37197791e189d02af9ab1a18c7a58b4f5f172e5acf1e4f8655a98dc01823684c6104adb8800741bba8a50173c
@@ -1,3 +1,8 @@
1
+ ## [v3.0.11] - 2017-06-24
2
+
3
+ - Add shoryuken sqs create. Tell about sqs create, if queue not found.
4
+ - [#388](https://github.com/phstc/shoryuken/pull/388)
5
+
1
6
  ## [v3.0.10] - 2017-06-24
2
7
 
3
8
  - Allow aws sdk v3
@@ -33,7 +33,7 @@ module Shoryuken
33
33
  entries: batch.map { |message| { id: message.message_id, receipt_handle: message.receipt_handle } }
34
34
  ).failed.any? do |failure|
35
35
  say(
36
- "Could not delete #{failure.id}, code: '#{failure.code}', message: '#{failure.message}', sender_fault: #{failure.sender_fault}",
36
+ "Could not delete #{failure.id}, code: #{failure.code}, message: #{failure.message}, sender_fault: #{failure.sender_fault}",
37
37
  :yellow
38
38
  )
39
39
  end
@@ -185,6 +185,13 @@ module Shoryuken
185
185
 
186
186
  say "Purge request sent for #{queue_name}. The message deletion process takes up to 60 seconds", :yellow
187
187
  end
188
+
189
+ desc 'create QUEUE-NAME', 'Create a queue'
190
+ def create(queue_name)
191
+ queue_url = sqs.create_queue(queue_name: queue_name).queue_url
192
+
193
+ say "Queue #{queue_name} was successfully created. Queue URL #{queue_url}", :green
194
+ end
188
195
  end
189
196
  end
190
197
  end
@@ -120,6 +120,22 @@ module Shoryuken
120
120
 
121
121
  def validate_queues
122
122
  return Shoryuken.logger.warn { 'No queues supplied' } if Shoryuken.queues.empty?
123
+ non_existent_queues = []
124
+
125
+ Shoryuken.queues.uniq.each do |queue|
126
+ begin
127
+ Shoryuken::Client.queues(queue)
128
+ rescue Aws::Errors::NoSuchEndpointError, Aws::SQS::Errors::NonExistentQueue
129
+ non_existent_queues << queue
130
+ end
131
+ end
132
+
133
+ return if non_existent_queues.none?
134
+
135
+ fail(
136
+ ArgumentError,
137
+ "The specified queue(s) #{non_existent_queues.join(', ')} do not exist.\nCheck 'shoryuken sqs create QUEUE-NAME' for creating a queue with default settings"
138
+ )
123
139
  end
124
140
 
125
141
  def validate_workers
@@ -1,3 +1,3 @@
1
1
  module Shoryuken
2
- VERSION = '3.0.10'.freeze
2
+ VERSION = '3.0.11'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shoryuken
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.10
4
+ version: 3.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pablo Cantero