algoliasearch 1.12.7 → 1.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +3 -0
- data/lib/algolia/index.rb +10 -1
- data/lib/algolia/version.rb +1 -1
- data/spec/client_spec.rb +6 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2c28ac6561ea6ee8b1bbd6d96f1d39ad455e134
|
4
|
+
data.tar.gz: c0da09cd340a8e6e37123c61455d87d0dd99435c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e51bae499fb4e185a9ee7303b46e7643e6867f79a9b31ab766cbcd44aa5e33426d7a029faa0bda63794e7c7b54aec974e67080ac0d9f4ac2bb559ad185940cba
|
7
|
+
data.tar.gz: 0b34163669b36db24e083857495c95900722ff5a20361d55c497092619befe9e799c7fe3a939a231eac3403f9fff61108c5a0b1b7c7df19e6efe134ae08f847e
|
data/ChangeLog
CHANGED
data/lib/algolia/index.rb
CHANGED
@@ -235,6 +235,15 @@ module Algolia
|
|
235
235
|
client.post(Protocol.objects_uri, { :requests => requests }.to_json, :read)['results']
|
236
236
|
end
|
237
237
|
|
238
|
+
# Check the status of a task on the server.
|
239
|
+
# All server task are asynchronous and you can check the status of a task with this method.
|
240
|
+
#
|
241
|
+
# @param taskID the id of the task returned by server
|
242
|
+
#
|
243
|
+
def get_task_status(taskID)
|
244
|
+
client.get(Protocol.task_uri(name, taskID), :read)["status"]
|
245
|
+
end
|
246
|
+
|
238
247
|
# Wait the publication of a task on the server.
|
239
248
|
# All server task are asynchronous and you can check with this method that the task is published.
|
240
249
|
#
|
@@ -243,7 +252,7 @@ module Algolia
|
|
243
252
|
#
|
244
253
|
def wait_task(taskID, timeBeforeRetry = 100)
|
245
254
|
loop do
|
246
|
-
status =
|
255
|
+
status = get_task_status(taskID)
|
247
256
|
if status == "published"
|
248
257
|
return
|
249
258
|
end
|
data/lib/algolia/version.rb
CHANGED
data/spec/client_spec.rb
CHANGED
@@ -691,6 +691,12 @@ describe 'Client' do
|
|
691
691
|
[true, false].should include(task['pendingTask'])
|
692
692
|
end
|
693
693
|
|
694
|
+
it 'Check attributes get_task_status' do
|
695
|
+
task = @index.add_object!({ :name => "John Doe", :email => "john@doe.org" }, "1")
|
696
|
+
status = @index.get_task_status(task["taskID"])
|
697
|
+
status.should be_a(String)
|
698
|
+
end
|
699
|
+
|
694
700
|
it "Check add keys" do
|
695
701
|
newIndexKey = @index.add_api_key(['search'])
|
696
702
|
newIndexKey.should have_key('key')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: algoliasearch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Algolia
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httpclient
|
@@ -131,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
131
131
|
version: '0'
|
132
132
|
requirements: []
|
133
133
|
rubyforge_project:
|
134
|
-
rubygems_version: 2.
|
134
|
+
rubygems_version: 2.6.8
|
135
135
|
signing_key:
|
136
136
|
specification_version: 4
|
137
137
|
summary: A simple Ruby client for the algolia.com REST API
|