algoliasearch 1.12.3 → 1.12.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4050df50fa8668d5c9c873c8783a195bd575dd6f
4
- data.tar.gz: 214b9bc3a0afc498470fe6d21fab6a3893ea138d
3
+ metadata.gz: b9f41ca052e472677a2d5ace620a14667d504ef2
4
+ data.tar.gz: 9d5867b170153d28d6e09d96b925ba5fb56816d1
5
5
  SHA512:
6
- metadata.gz: d92b856c6c07c952637e11c4108c7057f844bc8a0eab04e53a3aa9a0200124036220e8808db600892d1e63062ea8147210cdd41df33abf8eb3ad07c98d550688
7
- data.tar.gz: 534342154bf113bc6f65385c875907f0f90c48c464b73dbfb004372c3d3da57a67d5f3dd66f1c4c03eb97b065b85d371df8c3758cbaf1ff66cc7459a7559527c
6
+ metadata.gz: 0264feea12af5aa3ce81b87963e91131ee083f27db9e7ad09276040c29f72e1415832b60cbeb3692fd2ab6802ed7ad716ad223fa2947ceba22e6ce47507f9224
7
+ data.tar.gz: 7a22070b0bc43b1085ce606ab1d0593e05b76a3b20aa265d585d39498ac8434d4ee0913c84535944a017f87103d1b2922e61532bd83f8b833f8f7c830fc1c3ed
data/ChangeLog CHANGED
@@ -1,5 +1,8 @@
1
1
  CHANGELOG
2
2
 
3
+ 2016-12-07
4
+ * Fix DNS tests
5
+
3
6
  2016-12-06
4
7
  * Allow for multiple clients on different app ids on the same thread
5
8
 
@@ -1,3 +1,3 @@
1
1
  module Algolia
2
- VERSION = "1.12.3"
2
+ VERSION = "1.12.4"
3
3
  end
@@ -978,34 +978,37 @@ describe 'Client' do
978
978
  @index.search_synonyms('')['nbHits'].should eq(0)
979
979
  end
980
980
 
981
- if ENV['TRAVIS'].to_s != "true"
982
- context 'DNS timeout' do
983
- before(:all) do
984
- @client = Algolia::Client.new :application_id => ENV['ALGOLIA_APPLICATION_ID'], :api_key => ENV['ALGOLIA_API_KEY'],
985
- :hosts => [
986
- "#{ENV['ALGOLIA_APPLICATION_ID']}.algolia.biz",
987
- "#{ENV['ALGOLIA_APPLICATION_ID']}.algolia.net",
988
- "#{ENV['ALGOLIA_APPLICATION_ID']}-1.algolianet.com",
989
- "#{ENV['ALGOLIA_APPLICATION_ID']}-2.algolianet.com",
990
- "#{ENV['ALGOLIA_APPLICATION_ID']}-3.algolianet.com"
991
- ],
992
- :connect_timeout => 5
993
- end
981
+ context 'DNS timeout' do
982
+ before(:all) do
983
+ app_id = ENV['ALGOLIA_APPLICATION_ID']
984
+ Thread.current["algolia_hosts_#{app_id}"] = nil
985
+ Thread.current["algolia_search_hosts_#{app_id}"] = nil
986
+ Thread.current["algolia_host_index_#{app_id}"] = nil
987
+ Thread.current["algolia_search_host_index_#{app_id}"] = nil
988
+ @client = Algolia::Client.new :application_id => ENV['ALGOLIA_APPLICATION_ID'], :api_key => ENV['ALGOLIA_API_KEY'],
989
+ :hosts => [
990
+ "#{ENV['ALGOLIA_APPLICATION_ID']}.algolia.biz",
991
+ "#{ENV['ALGOLIA_APPLICATION_ID']}.algolia.net",
992
+ "#{ENV['ALGOLIA_APPLICATION_ID']}-1.algolianet.com",
993
+ "#{ENV['ALGOLIA_APPLICATION_ID']}-2.algolianet.com",
994
+ "#{ENV['ALGOLIA_APPLICATION_ID']}-3.algolianet.com"
995
+ ],
996
+ :connect_timeout => 5
997
+ end
994
998
 
995
- it "should fallback to the 2nd host after a few seconds" do
996
- start_time = Time.now
997
- @client.list_indexes # fallback on the second host after 5 sec (connection timeout)
998
- expect(start_time.to_i + 5).to be <= Time.now.to_i + 1
999
- end
999
+ it "should fallback to the 2nd host after a few seconds" do
1000
+ start_time = Time.now
1001
+ @client.list_indexes # fallback on the second host after 5 sec (connection timeout)
1002
+ expect(start_time.to_i + 5).to be <= Time.now.to_i + 1
1003
+ end
1000
1004
 
1001
- it "should re-use the working (2nd) host after the 1st one failed" do
1002
- start_time = Time.now
1003
- @client.list_indexes # fallback on the second host after 5 sec (connection timeout)
1004
- expect(start_time.to_i + 5).to be <= Time.now.to_i + 1
1005
- start_time = Time.now
1006
- @client.list_indexes # re-use the 2nd one
1007
- expect(start_time.to_i).to be <= Time.now.to_i + 1
1008
- end
1005
+ it "should re-use the working (2nd) host after the 1st one failed" do
1006
+ start_time = Time.now
1007
+ @client.list_indexes # fallback on the second host after 5 sec (connection timeout)
1008
+ expect(start_time.to_i + 5).to be <= Time.now.to_i + 1
1009
+ start_time = Time.now
1010
+ @client.list_indexes # re-use the 2nd one
1011
+ expect(start_time.to_i).to be <= Time.now.to_i + 1
1009
1012
  end
1010
1013
  end
1011
1014
 
@@ -11,6 +11,8 @@ describe 'With a mocked client' do
11
11
  app_id = Algolia.client.application_id
12
12
  Thread.current["algolia_hosts_#{app_id}"] = nil
13
13
  Thread.current["algolia_search_hosts_#{app_id}"] = nil
14
+ Thread.current["algolia_host_index_#{app_id}"] = nil
15
+ Thread.current["algolia_search_host_index_#{app_id}"] = nil
14
16
  end
15
17
 
16
18
  it "should add a simple object" do
@@ -10,6 +10,8 @@ describe 'With a rate limited client' do
10
10
  app_id = Algolia.client.application_id
11
11
  Thread.current["algolia_hosts_#{app_id}"] = nil
12
12
  Thread.current["algolia_search_hosts_#{app_id}"] = nil
13
+ Thread.current["algolia_host_index_#{app_id}"] = nil
14
+ Thread.current["algolia_search_host_index_#{app_id}"] = nil
13
15
  end
14
16
 
15
17
  it "should pass the right headers" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: algoliasearch
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.12.3
4
+ version: 1.12.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Algolia