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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0bc81cd3d15885fbfd0558a315efcabbd16f6701
4
- data.tar.gz: 271cf7be1cde08c996559900465ab98086cf6a33
3
+ metadata.gz: 7711534eafbbf16017703429b63228d6736a4c76
4
+ data.tar.gz: 3fd4fa2edf53a8238f0e189bae5b561661288cd4
5
5
  SHA512:
6
- metadata.gz: 92560308a67142a9b2ae4a3866c29860ed60871a4fac41a33893df04b829e33e71101af3fdbcde40f08897ca6bcfc3be87e867948f01faed06e469ff9c614da3
7
- data.tar.gz: a2a293e69048a1be851da508d704eb2df2d000f4cce035e8a7e57c65b233e104227263c6abd82ca7b64b5a92210ee10cbaa8a451bcccd99e23ef99aedfcbc53d
6
+ metadata.gz: d7b4f7c661730403a943d967553b7e5426ba32f6d4f8750ea7550cb8d84d05a41e311638c4b5ca78fc541e630f7b8ae42a967f0cfeefe01d446f47badd265ffc
7
+ data.tar.gz: 70f3a55a6bcc33e1552a4a999b7595f7c64231857bc872da1c33bf662a3a2afe5e41b05c223f45890fdbea4dbeb6068633b731ea4f3b6e95da03153257148c5b
@@ -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 DeserializationError
183
+ rescue
184
184
  # don't allow a failed deserialization to prevent destroying the job
185
185
  end
186
186
 
@@ -1,3 +1,3 @@
1
1
  module Delayed
2
- VERSION = "0.11.2"
2
+ VERSION = "0.11.3"
3
3
  end
@@ -26,3 +26,8 @@ module M
26
26
  def perform; @@runs += 1; end
27
27
  end
28
28
  end
29
+
30
+ class DeserializeErrorJob < SimpleJob; end
31
+ Psych.add_domain_type("ruby/object", "DeserializeErrorJob") do |_type, val|
32
+ raise "error deserializing"
33
+ end
@@ -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.2
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-06-23 00:00:00.000000000 Z
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