ddr-batch 1.6.0 → 1.6.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: 3cc0d7512f5de4438ed7d531a85b8415412ab8e7
4
- data.tar.gz: eedb1553d0cce6964bf053c1e278072fabff52fb
3
+ metadata.gz: 47936c2a8f4623a57dcffeb7ee73f4d0c70479a0
4
+ data.tar.gz: 8c6872a2ec76e0ab74566c7e56ef6cebbede24f8
5
5
  SHA512:
6
- metadata.gz: a4521f1634482447df5b845557a3eb1904aff89d339d851ea65041bd2fb828da8a32c356fb2c7dc8a89cb1d43afd1f7991c527c69c1104d3e5fb9fb0ce1b2062
7
- data.tar.gz: 721c3d5457bdf10f92d6ed7693218d0f6cfee503244eab62805949d3440e3c60a900904c797293a4092ffb2f7d1f812e281cf36a0414c1cc7f957788fd46df4a
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
- # Once any batch object included in this job fails to process successfully, do not attempt to process
16
- # any remaining batch objects included in this job. Instead, mark them as "handled" so the batch knows
17
- # it's not waiting on them to be handled before it can consider itself "finished".
18
- # The use case prompting this behavior is a job containing an Item ingest batch object plus one or more
19
- # associated Component ingest batch objects. If the Item batch object fails to process correctly, we don't
20
- # want to attempt to process the Component batch objects.
21
- # In the preceding use case, we could skip the remaining batch objects only if the failed batch object is an
22
- # Item but there might be future cases in which we don't want to process the remaining batch objects in the
23
- # job regardless of which batch object fails. The failure of any batch object to process should be rare
24
- # enough that it doesn't seem harmful to cover this potential broader use case in the current code.
25
- if success
26
- success = ProcessBatchObject.new(batch_object_id: batch_object_id, operator: operator).execute
27
- else
28
- batch_object = Ddr::Batch::BatchObject.find(batch_object_id)
29
- batch_object.update!(handled: true)
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
@@ -1,5 +1,5 @@
1
1
  module Ddr
2
2
  module Batch
3
- VERSION = "1.6.0"
3
+ VERSION = "1.6.1"
4
4
  end
5
5
  end
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.0
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: 2017-12-12 00:00:00.000000000 Z
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: 4.2.0
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: 4.2.0
55
+ version: '5.2'
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: ddr-models
58
58
  requirement: !ruby/object:Gem::Requirement