index-tanked 0.1.1 → 0.1.2

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.
@@ -14,9 +14,10 @@ module IndexTanked
14
14
  def add_to_index_tank(doc_id, data, fallback=true)
15
15
  begin
16
16
  raise IndexTanked::IndexingDisabledError unless IndexTanked::Configuration.index_available?
17
- if IndexTanked::Configuration.timeout
18
- IndexTankedTimer.timeout(IndexTanked::Configuration.timeout, TimeoutExceededError) do
19
- sleep(IndexTanked::Configuration.timeout + 1) if $testing_index_tanked_timeout
17
+ timeout = index_tanked.get_value_from(IndexTanked::Configuration.timeout)
18
+ if timeout
19
+ IndexTankedTimer.timeout(timeout, TimeoutExceededError) do
20
+ sleep(timeout + 1) if $testing_index_tanked_timeout
20
21
  @index_tanked.index.document(doc_id).add(*data)
21
22
  end
22
23
  else
@@ -41,9 +42,10 @@ module IndexTanked
41
42
  def delete_from_index_tank(doc_id, fallback=true)
42
43
  begin
43
44
  raise IndexTanked::IndexingDisabledError unless IndexTanked::Configuration.index_available?
44
- if IndexTanked::Configuration.timeout
45
- IndexTankedTimer.timeout(IndexTanked::Configuration.timeout, TimeoutExceededError) do
46
- sleep(IndexTanked::Configuration.timeout + 1) if $testing_index_tanked_timeout
45
+ timeout = index_tanked.get_value_from(IndexTanked::Configuration.timeout)
46
+ if timeout
47
+ IndexTankedTimer.timeout(timeout, TimeoutExceededError) do
48
+ sleep(timeout + 1) if $testing_index_tanked_timeout
47
49
  @index_tanked.index.document(doc_id).delete
48
50
  end
49
51
  else
@@ -1,3 +1,3 @@
1
1
  module IndexTanked
2
- GEM_VERSION = '0.1.1'
2
+ GEM_VERSION = '0.1.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: 25
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 1
10
- version: 0.1.1
9
+ - 2
10
+ version: 0.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Adam Kittelson