sidekiq-status 1.1.3 → 1.1.4

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
  SHA256:
3
- metadata.gz: 91dc4d7b8b58f85f9f04ea9a2346b64999f453fe186f9dcbaa915bdfa7432920
4
- data.tar.gz: f08db1e8246645be8783ac1e8a8fba46cc9e1777ee2049b7bc256ec07ee34454
3
+ metadata.gz: 852f99075106d76a18f3a0f21a3e49785069af7e8ee479c08959edeeef655439
4
+ data.tar.gz: 02fb95b39d1e37a081e64b2442a4c9a19b708d44bb52af24c1ccdff4d3a884c7
5
5
  SHA512:
6
- metadata.gz: 33943d5d8e663ba5ef5c58c692137f5e4cb8977ef15cab4862183cf2a473743da00c4f05837ef3b2e073c7c04c9a4e085ac561ab396c2269f59392bb90328edf
7
- data.tar.gz: 73a30ec1c4baafa8e28c45c04cabcc08f8612889a2398f9b7706bbf19b3e204e82d7aef73e1b9cbe91b5c562018ce2ab29bb5738425ad3ebb910f4b8fe62485c
6
+ metadata.gz: 7091b83f0ae9277478d75e6d5aab3a29936e76d0cb7c9f671031aa357e8fe2b4f1cacb92716fa3b5b2e474bbde3c5c26f8298195154d798f82d0f52a4e0661e7
7
+ data.tar.gz: 58c13e7c9fa8c1712bfbd47fbcb47a5cd69e0804093def9745de5d591d8dc1959e6701c6baff6efb808d305e7fe4f750859d5575f62b2d28f29484b6e2029f02
@@ -1,3 +1,6 @@
1
+ **Version 1.1.4**
2
+ * Ensures jobs without sidekiq-status do not record status exceptions (#150)
3
+
1
4
  **Version 1.1.3**
2
5
  * Adds a job status filter to the UI (#149)
3
6
 
@@ -61,7 +61,7 @@ module Sidekiq::Status
61
61
  status = :retrying
62
62
  end
63
63
  end
64
- store_status worker.jid, status, expiry
64
+ store_status(worker.jid, status, expiry) if job_class && job_class.ancestors.include?(Sidekiq::Status::Worker)
65
65
  raise
66
66
  end
67
67
 
@@ -1,5 +1,5 @@
1
1
  module Sidekiq
2
2
  module Status
3
- VERSION = '1.1.3'
3
+ VERSION = '1.1.4'
4
4
  end
5
5
  end
@@ -36,21 +36,39 @@ describe Sidekiq::Status::ServerMiddleware do
36
36
  it "sets failed status when Exception raised" do
37
37
  allow(SecureRandom).to receive(:hex).once.and_return(job_id)
38
38
  start_server do
39
- expect(capture_status_updates(3) {
40
- expect(FailingHardJob.perform_async).to eq(job_id)
41
- }).to eq([job_id]*3)
39
+ expect(capture_status_updates(3) {
40
+ expect(FailingHardJob.perform_async).to eq(job_id)
41
+ }).to eq([job_id]*3)
42
42
  end
43
43
  expect(redis.hget("sidekiq:status:#{job_id}", :status)).to eq('failed')
44
44
  expect(Sidekiq::Status::failed?(job_id)).to be_truthy
45
45
  end
46
46
 
47
+ context "when Sidekiq::Status::Worker is not included in the job" do
48
+ it "should not set a failed status" do
49
+ allow(SecureRandom).to receive(:hex).once.and_return(job_id)
50
+ start_server do
51
+ expect(FailingNoStatusJob.perform_async).to eq(job_id)
52
+ end
53
+ expect(redis.hget("sidekiq:status:#{job_id}", :status)).to be_nil
54
+ end
55
+
56
+ it "should not set any status when Exception raised" do
57
+ allow(SecureRandom).to receive(:hex).once.and_return(job_id)
58
+ start_server do
59
+ expect(FailingHardNoStatusJob.perform_async).to eq(job_id)
60
+ end
61
+ expect(redis.hget("sidekiq:status:#{job_id}", :status)).to be_nil
62
+ end
63
+ end
64
+
47
65
  context "sets interrupted status" do
48
66
  it "on system exit signal" do
49
67
  allow(SecureRandom).to receive(:hex).once.and_return(job_id)
50
68
  start_server do
51
- expect(capture_status_updates(3) {
52
- expect(ExitedJob.perform_async).to eq(job_id)
53
- }).to eq([job_id]*3)
69
+ expect(capture_status_updates(3) {
70
+ expect(ExitedJob.perform_async).to eq(job_id)
71
+ }).to eq([job_id]*3)
54
72
  end
55
73
  expect(redis.hget("sidekiq:status:#{job_id}", :status)).to eq('interrupted')
56
74
  expect(Sidekiq::Status::interrupted?(job_id)).to be_truthy
@@ -10,6 +10,16 @@ class StubJob
10
10
  end
11
11
  end
12
12
 
13
+ class StubNoStatusJob
14
+ include Sidekiq::Worker
15
+
16
+ sidekiq_options 'retry' => false
17
+
18
+ def perform(*args)
19
+ end
20
+ end
21
+
22
+
13
23
  class ExpiryJob < StubJob
14
24
  def expiration
15
25
  15
@@ -69,6 +79,12 @@ class FailingJob < StubJob
69
79
  end
70
80
  end
71
81
 
82
+ class FailingNoStatusJob < StubNoStatusJob
83
+ def perform
84
+ raise StandardError
85
+ end
86
+ end
87
+
72
88
  class RetryAndFailJob < StubJob
73
89
  sidekiq_options retry: 1
74
90
 
@@ -83,6 +99,12 @@ class FailingHardJob < StubJob
83
99
  end
84
100
  end
85
101
 
102
+ class FailingHardNoStatusJob < StubNoStatusJob
103
+ def perform
104
+ raise Exception
105
+ end
106
+ end
107
+
86
108
  class ExitedJob < StubJob
87
109
  def perform
88
110
  raise SystemExit
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: 1.1.3
4
+ version: 1.1.4
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: 2019-05-20 00:00:00.000000000 Z
12
+ date: 2019-06-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sidekiq