shoryuken 5.1.1 → 5.2.0
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c855ac4349659f917c53b48687c306ded163e5e0bcab0437eddca57544f4eb0f
|
4
|
+
data.tar.gz: 2e7494359335eee6f17f663fb43922ff4d5ef1944256a88472efe9a0b7391347
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6ab1140e26468002b6f1ca41a57296d8168fbf19caf4d5f47ec3e51e89c48b1a961a271d0a416b3f6f1b81b27a7fea775bf5a950fa9658fdcf6b97c095f571e
|
7
|
+
data.tar.gz: 4ea7336a630cc887e82b7adcbafda5ed373c7fa5b82147b6f7c0038099980c6c86457df6471507f15189ad2391cccd6224a898f91c086e6bdcb9053b858d9114
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
## [v5.2.0] - 2021-02-26
|
2
|
+
|
3
|
+
- Set `executions` correctly for ActiveJob jobs
|
4
|
+
- [#657](https://github.com/phstc/shoryuken/pull/657)
|
5
|
+
|
1
6
|
## [v5.1.1] - 2021-02-10
|
2
7
|
|
3
8
|
- Fix regression in Ruby 3.0 introduced in Shoryuken 5.1.0, where enqueueing jobs with ActiveJob to workers that used keyword arguments would fail
|
@@ -82,8 +82,10 @@ module ActiveJob
|
|
82
82
|
|
83
83
|
shoryuken_options body_parser: :json, auto_delete: true
|
84
84
|
|
85
|
-
def perform(
|
86
|
-
|
85
|
+
def perform(sqs_msg, hash)
|
86
|
+
receive_count = sqs_msg.attributes['ApproximateReceiveCount'].to_i
|
87
|
+
past_receives = receive_count - 1
|
88
|
+
Base.execute hash.merge({ 'executions' => past_receives })
|
87
89
|
end
|
88
90
|
end
|
89
91
|
|
data/lib/shoryuken/version.rb
CHANGED
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'active_job'
|
3
|
+
require 'shoryuken/extensions/active_job_extensions'
|
4
|
+
require 'shoryuken/extensions/active_job_adapter'
|
5
|
+
|
6
|
+
RSpec.describe ActiveJob::QueueAdapters::ShoryukenAdapter::JobWrapper do
|
7
|
+
subject { described_class.new }
|
8
|
+
|
9
|
+
describe '#perform' do
|
10
|
+
it 'sets executions to reflect approximate receive count' do
|
11
|
+
attributes = { 'ApproximateReceiveCount' => '42' }
|
12
|
+
sqs_msg = double Shoryuken::Message, attributes: attributes
|
13
|
+
job_hash = { 'arguments' => [1, 2, 3] }
|
14
|
+
job_hash_with_executions = { 'arguments' => [1, 2, 3], 'executions' => 41 }
|
15
|
+
expect(ActiveJob::Base).to receive(:execute).with(job_hash_with_executions)
|
16
|
+
|
17
|
+
subject.perform sqs_msg, job_hash
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
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: 5.
|
4
|
+
version: 5.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pablo Cantero
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-02-
|
11
|
+
date: 2021-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dotenv
|
@@ -172,6 +172,7 @@ files:
|
|
172
172
|
- spec/shoryuken/extensions/active_job_adapter_spec.rb
|
173
173
|
- spec/shoryuken/extensions/active_job_base_spec.rb
|
174
174
|
- spec/shoryuken/extensions/active_job_concurrent_send_adapter_spec.rb
|
175
|
+
- spec/shoryuken/extensions/active_job_wrapper_spec.rb
|
175
176
|
- spec/shoryuken/fetcher_spec.rb
|
176
177
|
- spec/shoryuken/manager_spec.rb
|
177
178
|
- spec/shoryuken/middleware/chain_spec.rb
|
@@ -228,6 +229,7 @@ test_files:
|
|
228
229
|
- spec/shoryuken/extensions/active_job_adapter_spec.rb
|
229
230
|
- spec/shoryuken/extensions/active_job_base_spec.rb
|
230
231
|
- spec/shoryuken/extensions/active_job_concurrent_send_adapter_spec.rb
|
232
|
+
- spec/shoryuken/extensions/active_job_wrapper_spec.rb
|
231
233
|
- spec/shoryuken/fetcher_spec.rb
|
232
234
|
- spec/shoryuken/manager_spec.rb
|
233
235
|
- spec/shoryuken/middleware/chain_spec.rb
|