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 +4 -4
- data/lib/asynchronic/process.rb +4 -4
- data/lib/asynchronic/version.rb +1 -1
- data/spec/jobs.rb +15 -0
- data/spec/process/life_cycle_examples.rb +10 -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: a48e57f1b93e2a2d84f3fba80708b40350c756db
|
4
|
+
data.tar.gz: 63e282e6e55c00d2ada87c934b6712f5f4de61c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3fb56ecfca909f90d6ab86ac280bf6b93211cbda896d82ae66d7e6de0f563d7dc3d25696167cd72f514d83f49af6237906915ba2ee73b4ff27082d42ea3c95cd
|
7
|
+
data.tar.gz: 036fb94d1c004a38a85bf4ce78bca64b102044b057289fe77b76f21c2189f2f7849ef7e56dddb6848ac1de7f313d5a8dd9f7537798ca8f88faa5721ab209a270
|
data/lib/asynchronic/process.rb
CHANGED
@@ -68,13 +68,13 @@ module Asynchronic
|
|
68
68
|
end
|
69
69
|
|
70
70
|
def real_error
|
71
|
-
|
71
|
+
return nil unless error
|
72
72
|
|
73
|
-
|
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
|
data/lib/asynchronic/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2017-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis
|