sidekiq-status 2.0.2 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/Appraisals +4 -0
- data/CHANGELOG.md +3 -0
- data/gemfiles/sidekiq_6.1.gemfile +7 -0
- data/lib/sidekiq-status/client_middleware.rb +4 -2
- data/lib/sidekiq-status/version.rb +1 -1
- data/spec/lib/sidekiq-status_spec.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc3436d5bc785da39c9f4f9d56d8179d75acc534935b9cab980ef7266bcdbe94
|
4
|
+
data.tar.gz: 373f55bc1dc6cb235fe1f858ceb6ccb49fbe4e8864e9dd1951c83cd1ae053e69
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30ac2390e17ceb73ace6481921e28ad42ab2111012007ff2577a997ca7f34a6e8da59f06fa856f7abcbb07086c1863110417a6c2063399af672ee3e17fc227ad
|
7
|
+
data.tar.gz: b0084cbfdd76b4215d6787b5d910d84722bc538de84ef0f0663990a2dd0ec2ed3bc3e8aee9b71b50336517c11c86843c5abd190964c6321e5a0c27f8353f3fb3
|
data/.travis.yml
CHANGED
data/Appraisals
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
require 'sidekiq/api'
|
2
|
+
JOB_CLASS = Sidekiq.constants.include?(:JobRecord) ? Sidekiq::JobRecord : Sidekiq::Job
|
3
|
+
|
2
4
|
module Sidekiq::Status
|
3
5
|
# Should be in the client middleware chain
|
4
6
|
class ClientMiddleware
|
@@ -34,7 +36,7 @@ module Sidekiq::Status
|
|
34
36
|
initial_metadata = {
|
35
37
|
jid: msg['jid'],
|
36
38
|
status: :queued,
|
37
|
-
worker:
|
39
|
+
worker: JOB_CLASS.new(msg, queue).display_class,
|
38
40
|
args: display_args(msg, queue)
|
39
41
|
}
|
40
42
|
store_for_id msg['jid'], initial_metadata, job_class.new.expiration || @expiration, redis_pool
|
@@ -45,7 +47,7 @@ module Sidekiq::Status
|
|
45
47
|
end
|
46
48
|
|
47
49
|
def display_args(msg, queue)
|
48
|
-
job =
|
50
|
+
job = JOB_CLASS.new(msg, queue)
|
49
51
|
return job.display_args.to_a.empty? ? nil : job.display_args.to_json
|
50
52
|
rescue Exception => e
|
51
53
|
# For Sidekiq ~> 2.7
|
@@ -159,7 +159,7 @@ describe Sidekiq::Status do
|
|
159
159
|
end
|
160
160
|
|
161
161
|
it "retries failed jobs" do
|
162
|
-
allow(SecureRandom).to receive(:hex).and_return(retried_job_id)
|
162
|
+
allow(SecureRandom).to receive(:hex).exactly(3).times.and_return(retried_job_id)
|
163
163
|
start_server do
|
164
164
|
expect(capture_status_updates(3) {
|
165
165
|
expect(RetriedJob.perform_async()).to eq(retried_job_id)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sidekiq-status
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Evgeniy Tsvigun
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-
|
12
|
+
date: 2021-09-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sidekiq
|
@@ -142,6 +142,7 @@ files:
|
|
142
142
|
- README.md
|
143
143
|
- Rakefile
|
144
144
|
- gemfiles/sidekiq_5.x.gemfile
|
145
|
+
- gemfiles/sidekiq_6.1.gemfile
|
145
146
|
- gemfiles/sidekiq_6.x.gemfile
|
146
147
|
- lib/sidekiq-status.rb
|
147
148
|
- lib/sidekiq-status/client_middleware.rb
|