ddr-batch 1.6.0 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/services/ddr/batch/process_batch_objects.rb +19 -15
- data/lib/ddr/batch/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 47936c2a8f4623a57dcffeb7ee73f4d0c70479a0
|
|
4
|
+
data.tar.gz: 8c6872a2ec76e0ab74566c7e56ef6cebbede24f8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 07cd699a647c23525d78b81f941c793faca16b270d8456365e241a17df2d9e077f23343f41c77a443a7b0066c08af33688fd7c2baa2626564e4582ec18871744
|
|
7
|
+
data.tar.gz: 754c0dee555383ad65d5434b09d95ef40638ee0f6e1f39685f22ff044b8daf50952d716121817bf4b6794b032b626e9858381ddfb8d8ab4e87deb221e3cce8b4
|
|
@@ -12,21 +12,25 @@ module Ddr::Batch
|
|
|
12
12
|
# Assume successful processing of all batch objects until proven otherwise.
|
|
13
13
|
success = true
|
|
14
14
|
batch_object_ids.each do |batch_object_id|
|
|
15
|
-
|
|
16
|
-
#
|
|
17
|
-
#
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
15
|
+
batch_object = Ddr::Batch::BatchObject.find(batch_object_id)
|
|
16
|
+
# Skip batch objects that have already been successfully processed. This is useful when this service is
|
|
17
|
+
# called within the context of a BatchObjectsProcessorJob, that job fails, and the failed job is retried.
|
|
18
|
+
unless batch_object.verified?
|
|
19
|
+
# Once any batch object included in this job fails to process successfully, do not attempt to process
|
|
20
|
+
# any remaining batch objects included in this job. Instead, mark them as "handled" so the batch knows
|
|
21
|
+
# it's not waiting on them to be handled before it can consider itself "finished".
|
|
22
|
+
# The use case prompting this behavior is a job containing an Item ingest batch object plus one or more
|
|
23
|
+
# associated Component ingest batch objects. If the Item batch object fails to process correctly, we don't
|
|
24
|
+
# want to attempt to process the Component batch objects.
|
|
25
|
+
# In the preceding use case, we could skip the remaining batch objects only if the failed batch object is an
|
|
26
|
+
# Item but there might be future cases in which we don't want to process the remaining batch objects in the
|
|
27
|
+
# job regardless of which batch object fails. The failure of any batch object to process should be rare
|
|
28
|
+
# enough that it doesn't seem harmful to cover this potential broader use case in the current code.
|
|
29
|
+
if success
|
|
30
|
+
success = ProcessBatchObject.new(batch_object_id: batch_object.id, operator: operator).execute
|
|
31
|
+
else
|
|
32
|
+
batch_object.update!(handled: true)
|
|
33
|
+
end
|
|
30
34
|
end
|
|
31
35
|
end
|
|
32
36
|
end
|
data/lib/ddr/batch/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ddr-batch
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.6.
|
|
4
|
+
version: 1.6.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jim Coble
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date:
|
|
12
|
+
date: 2018-03-13 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rails
|
|
@@ -45,14 +45,14 @@ dependencies:
|
|
|
45
45
|
requirements:
|
|
46
46
|
- - "~>"
|
|
47
47
|
- !ruby/object:Gem::Version
|
|
48
|
-
version:
|
|
48
|
+
version: '5.2'
|
|
49
49
|
type: :runtime
|
|
50
50
|
prerelease: false
|
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
|
52
52
|
requirements:
|
|
53
53
|
- - "~>"
|
|
54
54
|
- !ruby/object:Gem::Version
|
|
55
|
-
version:
|
|
55
|
+
version: '5.2'
|
|
56
56
|
- !ruby/object:Gem::Dependency
|
|
57
57
|
name: ddr-models
|
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|