index-tanked 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -55,7 +55,15 @@ module IndexTanked
55
55
  end
56
56
 
57
57
  def self.enqueue(record_id, model_name, document_hash)
58
- delete_all(:record_id => record_id, :model_name => model_name, :locked_by => nil)
58
+ retries = 0
59
+ begin
60
+ delete_all(:record_id => record_id, :model_name => model_name, :locked_by => nil)
61
+ rescue ActiveRecord::StatementInvalid => e
62
+ if e.message.match(/deadlock/) && retries < 3
63
+ retries += 1
64
+ retry
65
+ end
66
+ end
59
67
  create(:record_id => record_id, :model_name => model_name, :document => document_hash)
60
68
  end
61
69
 
@@ -1,3 +1,3 @@
1
1
  module IndexTanked
2
- GEM_VERSION = '0.3.1'
2
+ GEM_VERSION = '0.3.2'
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: 17
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 1
10
- version: 0.3.1
9
+ - 2
10
+ version: 0.3.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Adam Kittelson
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-06-17 00:00:00 -07:00
19
+ date: 2011-06-20 00:00:00 -07:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency