spotlight-dor-resources 0.2.2 → 0.2.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: 41182091efc4f6afdff109e9138f81e47da10842
4
- data.tar.gz: 5c7a966692a014d605cf86d254ff3ebd314f8ccd
3
+ metadata.gz: 51c2413bf267fceeaae2eb498ad5c81b44c40877
4
+ data.tar.gz: f4f60e931737ebc840ad61f7b7fb1d272dd106b5
5
5
  SHA512:
6
- metadata.gz: 6dd2325ff88adfcaa2742de50dfc93acf3b9abceca2c7e51d313e9ed217ba124f61392195fb59bdc0821d3db2053a2d844bff4a24fc3cef9aecbb9aa2614c0a8
7
- data.tar.gz: 5f30137f8f65572919015e4c9ccc9bc36f2d37b4e582eb7d061ea6d73b02a30a4a10687a7971adc2f437d94254b24c46bc9bf6f4e728c5f0a058c5309b5d3350
6
+ metadata.gz: b7d71a1624eaad421bd9784b35db016cfa972df641aabe2be42c780b611a5dc35b90d5777e42337a935bd9c397d79a9cf5ed46aa6e1fd4545cbd3d3e1f3fbb9b
7
+ data.tar.gz: b68375cd5b0793f4f035ce79007175468e9368c373001a968940a366982f5dcb71888f14f27720ba65b1467d894d889e290c93e822c394d0ceaf29df1359b85f
@@ -15,7 +15,8 @@ module Spotlight::Resources
15
15
 
16
16
  indexable_resources.each_with_index do |res, idx|
17
17
  benchmark "Indexing item #{res.druid} in resource #{id} (#{idx} / #{size})" do
18
- yield base_doc.merge(to_solr_document(res))
18
+ doc = to_solr_document(res)
19
+ yield base_doc.merge(doc) if doc
19
20
  end
20
21
  end
21
22
  end
@@ -55,6 +56,9 @@ module Spotlight::Resources
55
56
  # @return [Hash]
56
57
  def to_solr_document(resource)
57
58
  Spotlight::Dor::Resources.indexer.solr_document(resource)
59
+ rescue RuntimeError => e
60
+ logger.error("Error processing #{resource.druid}: #{e}")
61
+ nil
58
62
  end
59
63
 
60
64
  ##
@@ -2,7 +2,7 @@ module Spotlight
2
2
  module Dor
3
3
  # :nodoc:
4
4
  module Resources
5
- VERSION = '0.2.2'
5
+ VERSION = '0.2.3'
6
6
  end
7
7
  end
8
8
  end
@@ -101,6 +101,12 @@ describe Spotlight::Resources::Purl do
101
101
  expect(solr_doc.first).to include :collection
102
102
  expect(solr_doc.last).to include :item
103
103
  end
104
+
105
+ it 'traps indexing errors' do
106
+ allow(subject.resource).to receive(:items).and_return([])
107
+ expect(Spotlight::Dor::Resources.indexer).to receive(:solr_document).and_raise(RuntimeError.new)
108
+ expect { subject.to_solr.to_a }.not_to raise_error
109
+ end
104
110
  end
105
111
 
106
112
  context 'with a single item' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spotlight-dor-resources
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-13 00:00:00.000000000 Z
11
+ date: 2015-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday