shoryuken 4.0.1 → 4.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/lib/shoryuken.rb +2 -2
- data/lib/shoryuken/options.rb +13 -13
- data/lib/shoryuken/queue.rb +2 -2
- data/lib/shoryuken/version.rb +1 -1
- data/spec/shoryuken/middleware/server/auto_extend_visibility_spec.rb +1 -1
- data/spec/shoryuken/queue_spec.rb +3 -3
- data/spec/spec_helper.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 020543c4df213954780e2db9436ab1ff93d481c5
|
4
|
+
data.tar.gz: fe7346621ec5e094ff5d13fcfb12591595ab678e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f902d276c0255c23c2103375aac35f545fd8a3ad477e940a0f2628ed6d00874aa5dab09731f8c1554ebf1a9426b858075f16b20921c08536e54c26424f34de16
|
7
|
+
data.tar.gz: b95c4a300b3df721c5a11a7871870b08d77068bdabb46773d276dc98d040f56a66407e5dc6a6cda08d843d5f69ccc1d953ce6e718e593a0950c8da344bc45ec7
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
## [v4.0.2] - 2018-11-26
|
2
|
+
|
3
|
+
- Fix the delegated methods to public warning
|
4
|
+
- [#536](https://github.com/phstc/shoryuken/pull/536)
|
5
|
+
|
6
|
+
- Specify exception class to `raise_error` matcher warning
|
7
|
+
- [#537](https://github.com/phstc/shoryuken/pull/537)
|
8
|
+
|
9
|
+
- Fix spelling of "visibility"
|
10
|
+
- [#538](https://github.com/phstc/shoryuken/pull/538)
|
11
|
+
|
1
12
|
## [v4.0.1] - 2018-11-21
|
2
13
|
|
3
14
|
- Allow caching visibility_timeout lookups
|
data/lib/shoryuken.rb
CHANGED
data/lib/shoryuken/options.rb
CHANGED
@@ -23,7 +23,7 @@ module Shoryuken
|
|
23
23
|
@@stop_callback = nil
|
24
24
|
@@worker_executor = Worker::DefaultExecutor
|
25
25
|
@@launcher_executor = nil
|
26
|
-
@@
|
26
|
+
@@cache_visibility_timeout = false
|
27
27
|
|
28
28
|
class << self
|
29
29
|
def active_job?
|
@@ -199,6 +199,18 @@ module Shoryuken
|
|
199
199
|
options[:lifecycle_events][event] << block
|
200
200
|
end
|
201
201
|
|
202
|
+
def server?
|
203
|
+
defined?(Shoryuken::CLI)
|
204
|
+
end
|
205
|
+
|
206
|
+
def cache_visibility_timeout?
|
207
|
+
@@cache_visibility_timeout
|
208
|
+
end
|
209
|
+
|
210
|
+
def cache_visibility_timeout=(cache_visibility_timeout)
|
211
|
+
@@cache_visibility_timeout = cache_visibility_timeout
|
212
|
+
end
|
213
|
+
|
202
214
|
private
|
203
215
|
|
204
216
|
def default_server_middleware
|
@@ -217,18 +229,6 @@ module Shoryuken
|
|
217
229
|
def default_client_middleware
|
218
230
|
Middleware::Chain.new
|
219
231
|
end
|
220
|
-
|
221
|
-
def server?
|
222
|
-
defined?(Shoryuken::CLI)
|
223
|
-
end
|
224
|
-
|
225
|
-
def cache_visiblity_timeout?
|
226
|
-
@@cache_visiblity_timeout
|
227
|
-
end
|
228
|
-
|
229
|
-
def cache_visiblity_timeout=(cache_visiblity_timeout)
|
230
|
-
@@cache_visiblity_timeout = cache_visiblity_timeout
|
231
|
-
end
|
232
232
|
end
|
233
233
|
end
|
234
234
|
end
|
data/lib/shoryuken/queue.rb
CHANGED
@@ -14,9 +14,9 @@ module Shoryuken
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def visibility_timeout
|
17
|
-
# Always lookup for the latest
|
17
|
+
# Always lookup for the latest visibility when cache is disabled
|
18
18
|
# setting it to nil, forces re-lookup
|
19
|
-
@_visibility_timeout = nil unless Shoryuken.
|
19
|
+
@_visibility_timeout = nil unless Shoryuken.cache_visibility_timeout?
|
20
20
|
@_visibility_timeout ||= queue_attributes.attributes[VISIBILITY_TIMEOUT_ATTR].to_i
|
21
21
|
end
|
22
22
|
|
data/lib/shoryuken/version.rb
CHANGED
@@ -53,7 +53,7 @@ RSpec.describe Shoryuken::Middleware::Server::AutoExtendVisibility do
|
|
53
53
|
allow(sqs_msg).to receive(:queue) { sqs_queue }
|
54
54
|
expect(sqs_msg).to_not receive(:change_visibility)
|
55
55
|
|
56
|
-
expect { Runner.new.run_and_raise(TestWorker.new, queue, sqs_msg) }.to raise_error
|
56
|
+
expect { Runner.new.run_and_raise(TestWorker.new, queue, sqs_msg) }.to raise_error(RuntimeError)
|
57
57
|
end
|
58
58
|
|
59
59
|
it 'does not extend message visibility if auto_visibility_timeout is not true' do
|
@@ -235,7 +235,7 @@ RSpec.describe Shoryuken::Queue do
|
|
235
235
|
end
|
236
236
|
end
|
237
237
|
|
238
|
-
describe '#
|
238
|
+
describe '#visibility_timeout' do
|
239
239
|
let(:attribute_response) { double 'Aws::SQS::Types::GetQueueAttributesResponse' }
|
240
240
|
|
241
241
|
before do
|
@@ -247,7 +247,7 @@ RSpec.describe Shoryuken::Queue do
|
|
247
247
|
|
248
248
|
context 'when cache is disabled' do
|
249
249
|
specify do
|
250
|
-
Shoryuken.
|
250
|
+
Shoryuken.cache_visibility_timeout = false
|
251
251
|
|
252
252
|
expect(sqs).to(
|
253
253
|
receive(:get_queue_attributes).with(queue_url: queue_url, attribute_names: ['All']).and_return(attribute_response).exactly(3).times
|
@@ -260,7 +260,7 @@ RSpec.describe Shoryuken::Queue do
|
|
260
260
|
|
261
261
|
context 'when cache is enabled' do
|
262
262
|
it 'memoizes response' do
|
263
|
-
Shoryuken.
|
263
|
+
Shoryuken.cache_visibility_timeout = true
|
264
264
|
|
265
265
|
expect(sqs).to(
|
266
266
|
receive(:get_queue_attributes).with(queue_url: queue_url, attribute_names: ['All']).and_return(attribute_response).once
|
data/spec/spec_helper.rb
CHANGED
@@ -61,7 +61,7 @@ RSpec.configure do |config|
|
|
61
61
|
|
62
62
|
Shoryuken.sqs_client_receive_message_opts.clear
|
63
63
|
|
64
|
-
Shoryuken.
|
64
|
+
Shoryuken.cache_visibility_timeout = false
|
65
65
|
|
66
66
|
allow(Concurrent).to receive(:global_io_executor).and_return(Concurrent::ImmediateExecutor.new)
|
67
67
|
allow(Shoryuken).to receive(:active_job?).and_return(false)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shoryuken
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pablo Cantero
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-11-
|
11
|
+
date: 2018-11-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|