inst-jobs 0.11.2 → 0.11.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/delayed/backend/base.rb +1 -1
- data/lib/delayed/version.rb +1 -1
- data/spec/sample_jobs.rb +5 -0
- data/spec/shared/worker.rb +16 -0
- 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: 7711534eafbbf16017703429b63228d6736a4c76
|
4
|
+
data.tar.gz: 3fd4fa2edf53a8238f0e189bae5b561661288cd4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7b4f7c661730403a943d967553b7e5426ba32f6d4f8750ea7550cb8d84d05a41e311638c4b5ca78fc541e630f7b8ae42a967f0cfeefe01d446f47badd265ffc
|
7
|
+
data.tar.gz: 70f3a55a6bcc33e1552a4a999b7595f7c64231857bc872da1c33bf662a3a2afe5e41b05c223f45890fdbea4dbeb6068633b731ea4f3b6e95da03153257148c5b
|
data/lib/delayed/backend/base.rb
CHANGED
@@ -180,7 +180,7 @@ module Delayed
|
|
180
180
|
# notify the payload_object of a permanent failure
|
181
181
|
obj = payload_object
|
182
182
|
obj.on_permanent_failure(error) if obj && obj.respond_to?(:on_permanent_failure)
|
183
|
-
rescue
|
183
|
+
rescue
|
184
184
|
# don't allow a failed deserialization to prevent destroying the job
|
185
185
|
end
|
186
186
|
|
data/lib/delayed/version.rb
CHANGED
data/spec/sample_jobs.rb
CHANGED
data/spec/shared/worker.rb
CHANGED
@@ -354,6 +354,22 @@ shared_examples_for 'Delayed::Worker' do
|
|
354
354
|
end
|
355
355
|
end
|
356
356
|
|
357
|
+
describe "custom deserialization errors" do
|
358
|
+
it "should reschedule with more attempts left" do
|
359
|
+
job = Delayed::Job.create({:payload_object => DeserializeErrorJob.new, max_attempts: 2})
|
360
|
+
job.instance_variable_set("@payload_object", nil)
|
361
|
+
worker = Delayed::Worker.new(:max_priority => nil, :min_priority => nil, :quiet => true)
|
362
|
+
expect { worker.perform(job) }.not_to raise_error
|
363
|
+
end
|
364
|
+
|
365
|
+
it "run permanent failure code on last attempt" do
|
366
|
+
job = Delayed::Job.create({:payload_object => DeserializeErrorJob.new, max_attempts: 1})
|
367
|
+
job.instance_variable_set("@payload_object", nil)
|
368
|
+
worker = Delayed::Worker.new(:max_priority => nil, :min_priority => nil, :quiet => true)
|
369
|
+
expect { worker.perform(job) }.not_to raise_error
|
370
|
+
end
|
371
|
+
end
|
372
|
+
|
357
373
|
describe "#start" do
|
358
374
|
it "fires off an execute callback on the processing jobs loop" do
|
359
375
|
fired = false
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inst-jobs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tobias Luetke
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-07-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: after_transaction_commit
|