index-tanked 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -14,7 +14,11 @@ 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
- timeout = index_tanked.get_value_from(IndexTanked::Configuration.timeout)
17
+ timeout = if IndexTanked::Configuration.timeout.is_a?(Proc)
18
+ IndexTanked::Configuration.timeout.call
19
+ else
20
+ IndexTanked::Configuration.timeout
21
+ end
18
22
  if timeout
19
23
  IndexTankedTimer.timeout(timeout, TimeoutExceededError) do
20
24
  sleep(timeout + 1) if $testing_index_tanked_timeout
@@ -42,7 +46,11 @@ module IndexTanked
42
46
  def delete_from_index_tank(doc_id, fallback=true)
43
47
  begin
44
48
  raise IndexTanked::IndexingDisabledError unless IndexTanked::Configuration.index_available?
45
- timeout = index_tanked.get_value_from(IndexTanked::Configuration.timeout)
49
+ timeout = if IndexTanked::Configuration.timeout.is_a?(Proc)
50
+ IndexTanked::Configuration.timeout.call
51
+ else
52
+ IndexTanked::Configuration.timeout
53
+ end
46
54
  if timeout
47
55
  IndexTankedTimer.timeout(timeout, TimeoutExceededError) do
48
56
  sleep(timeout + 1) if $testing_index_tanked_timeout
@@ -1,3 +1,3 @@
1
1
  module IndexTanked
2
- GEM_VERSION = '0.1.2'
2
+ GEM_VERSION = '0.1.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: 31
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 2
10
- version: 0.1.2
9
+ - 3
10
+ version: 0.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Adam Kittelson