asynchronic 1.3.0 → 1.3.1

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: 7a56b4d0f2c929275129ed42f2ff2d92e26b9646
4
- data.tar.gz: 74208ec62350e6bea9f0dcfb512ed6150a2e1517
3
+ metadata.gz: a48e57f1b93e2a2d84f3fba80708b40350c756db
4
+ data.tar.gz: 63e282e6e55c00d2ada87c934b6712f5f4de61c3
5
5
  SHA512:
6
- metadata.gz: 8801974149b1b5715904b908d55f69c57bd922fbb4c4b8aa9586d7164f3a21302d81b63015b548a3a5997fcabf8368296f87ec97b927a943f0b72916014b5762
7
- data.tar.gz: 08cd125a279e9593c9aec42b8858831762bba28e5cd1c63bf645a1a9177acb00e21db47b5ca890ef8c3930df795526542395b5bf6531758942aff7f68f19915a
6
+ metadata.gz: 3fb56ecfca909f90d6ab86ac280bf6b93211cbda896d82ae66d7e6de0f563d7dc3d25696167cd72f514d83f49af6237906915ba2ee73b4ff27082d42ea3c95cd
7
+ data.tar.gz: 036fb94d1c004a38a85bf4ce78bca64b102044b057289fe77b76f21c2189f2f7849ef7e56dddb6848ac1de7f313d5a8dd9f7537798ca8f88faa5721ab209a270
@@ -68,13 +68,13 @@ module Asynchronic
68
68
  end
69
69
 
70
70
  def real_error
71
- childs = processes
71
+ return nil unless error
72
72
 
73
- return error.message if childs.empty?
74
-
75
- childs.each do |child|
73
+ processes.each do |child|
76
74
  return child.real_error if child.error
77
75
  end
76
+
77
+ error.message
78
78
  end
79
79
 
80
80
  def dependencies
@@ -1,3 +1,3 @@
1
1
  module Asynchronic
2
- VERSION = '1.3.0'
2
+ VERSION = '1.3.1'
3
3
  end
data/spec/jobs.rb CHANGED
@@ -240,6 +240,21 @@ class DataJob < Asynchronic::Job
240
240
  end
241
241
 
242
242
 
243
+ class NestedJobWithErrorInParent< Asynchronic::Job
244
+ def call
245
+ async Child_1
246
+ raise "Error in parent"
247
+ nil
248
+ end
249
+
250
+ class Child_1 < Asynchronic::Job
251
+ def call
252
+ nil
253
+ end
254
+ end
255
+ end
256
+
257
+
243
258
  class NestedJobWithErrorInChild < Asynchronic::Job
244
259
 
245
260
  def call
@@ -476,4 +476,14 @@ module LifeCycleExamples
476
476
  process.real_error.must_equal "Error in Child_2_2"
477
477
  end
478
478
 
479
+ it 'NestedJobWithErrorInParent' do
480
+ process = create NestedJobWithErrorInParent, queue: :test_queue
481
+
482
+ process.enqueue
483
+
484
+ execute queue_engine[:test_queue]
485
+
486
+ process.real_error.must_equal "Error in parent"
487
+ end
488
+
479
489
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asynchronic
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriel Naiman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-02 00:00:00.000000000 Z
11
+ date: 2017-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis