index-tanked 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -54,7 +54,17 @@ module IndexTanked
54
54
  index_name = companion_key.split(' - ').last
55
55
  record_count = partitioned_documents[companion_key].size
56
56
  log("#{record_count} document(s) prepared for #{index_name}.")
57
- Queue::Document.index_tanked(companion_key).index.batch_insert(partitioned_documents[companion_key])
57
+ begin
58
+ this_batch = partitioned_documents[companion_key]
59
+ Queue::Document.index_tanked(companion_key).index.batch_insert(this_batch)
60
+ rescue IndexTank::InvalidArgument => e
61
+ bad_document_number = e.message.scan(/in document #(\d+) of \d+/).flatten.first
62
+ bad_document_number = bad_document_number && (bad_document_number.to_i - 1)
63
+ if bad_document_number
64
+ log "Bad Document: #{this_batch[bad_document_number]}"
65
+ end
66
+ raise
67
+ end
58
68
  end
59
69
  end
60
70
 
@@ -1,3 +1,3 @@
1
1
  module IndexTanked
2
- GEM_VERSION = '0.2.2'
2
+ GEM_VERSION = '0.2.3'
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: index-tanked
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 2
10
- version: 0.2.2
9
+ - 3
10
+ version: 0.2.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Adam Kittelson