elasticsearch-model-extensions 0.3.3 → 0.3.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f0f78172ce35c1b446d6893e48dfb62a8483c2f0
4
- data.tar.gz: 4ccd0c9871b9065fdee06cdd4f32c82b9e6d0825
3
+ metadata.gz: e316ee3218af428b4a389ab08556725e7ad772b2
4
+ data.tar.gz: 164066107bc9f296b7ba7359e987f33bb413b76e
5
5
  SHA512:
6
- metadata.gz: b39a2c10cb9fa7f87818d018912354423fe72bb071080f820b63898a27ce0368cbf9308e35356dff3a0699169158d8ef0fd32181f18a90353f72445b80913ef5
7
- data.tar.gz: ce75230625c47a6122d25ebf2b0d47c83c3e67a5fb7dd354a1ab646ecaee80bc922ae3dfd2404929e20b3808fbcd5678fa54df81395212f0236d804e07521b97
6
+ metadata.gz: 46420f7a1fc3c05093258111928493df2877c64a32e13eb04cd75c7ac52241d83e0b09d9c254ebd915befbda41c5865b5409962aa96fcd74ecfc47b4429665af
7
+ data.tar.gz: 0ad648806fbdfe7f0c27294de2e1cfad50d928407993eab18e62122098d9658308baee9e12e124ff6f6eef25e420a99f8748049c0fd4f391920cecf6b1b25014
@@ -13,7 +13,8 @@ module Elasticsearch
13
13
 
14
14
  def reconnect!
15
15
  klass.connection.reconnect!
16
- klass.__elasticsearch__.client = Elasticsearch::Client.new(host: klass.elasticsearch_hosts)
16
+ # This is required to prevent requests from timing out when they are made in multiple processes(in other words, the process is forked).
17
+ klass.__elasticsearch__.client.transport.reload_connections!
17
18
  end
18
19
 
19
20
  # @param [Array] records
@@ -1,7 +1,7 @@
1
1
  module Elasticsearch
2
2
  module Model
3
3
  module Extensions
4
- VERSION = "0.3.3"
4
+ VERSION = "0.3.4"
5
5
  end
6
6
  end
7
7
  end
@@ -40,34 +40,12 @@ RSpec.describe Elasticsearch::Model::Extensions::BatchUpdating do
40
40
  end
41
41
  end
42
42
 
43
- describe '.elasticsearch_hosts' do
43
+ describe '#reconnect!' do
44
44
  subject {
45
- Article.elasticsearch_hosts
45
+ -> { Article.__batch_updater__.reconnect! }
46
46
  }
47
47
 
48
- context 'without a `elasticsearch_hosts` implementation' do
49
- specify {
50
- expect { subject }.to raise_error
51
- }
52
-
53
- specify {
54
- expect { Article.__batch_updater__.reconnect! }.to raise_error
55
- }
56
- end
57
-
58
- context 'with a `elasticsearch_hosts` implementation' do
59
- before(:each) do
60
- Article.class_eval do
61
- def self.elasticsearch_hosts
62
- 'http://localhost:9250'
63
- end
64
- end
65
- end
66
-
67
- specify {
68
- expect { subject }.to_not raise_error
69
- }
70
- end
48
+ it { is_expected.not_to raise_error }
71
49
  end
72
50
 
73
51
  context 'the index dropped' do
@@ -76,11 +54,6 @@ RSpec.describe Elasticsearch::Model::Extensions::BatchUpdating do
76
54
  Article.__elasticsearch__.refresh_index!
77
55
 
78
56
  Article.class_eval do
79
- def self.elasticsearch_hosts
80
- listened_port = (ENV['TEST_CLUSTER_PORT'] || 9250)
81
- "http://localhost:#{listened_port}/"
82
- end
83
-
84
57
  def self.with_indexed_tables_included
85
58
  includes(:comments)
86
59
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elasticsearch-model-extensions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yusuke KUOKA
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-21 00:00:00.000000000 Z
11
+ date: 2015-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler