fourkites-sqspoller 0.1.12.13 → 0.1.12.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/sqspoller/worker_task.rb +17 -6
- data/sqspoller.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YzcxMjRlYjI0MGUxMTU1NzhmNzBhNDg2Mzg0NzUyMmMzMzU2Nzg0NQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OWJlMzg1ZmY0MGIxYjk4MzcyZTdiZjg3ZTc4NWM1N2I1MmYwZWJiZA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
N2UxYzAxZmUzMjIwY2YzMDRiMzZiNGVjYWY3ZDU4ZTJiNGYyYzQxZjAyZGJm
|
10
|
+
YTA0YzBlM2Y5NzFmYTU2NWIwOGE1ZjkwZDQ2NWZiYTZhYjg0ZWVkN2Y2ZGQ3
|
11
|
+
YWYyMDliNTk5ZDljOWUyODQxOGFlM2MzNzVmNmUyOTg3YTM3MDA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OTAzZTMxNzcwNjc5ODlmMjgxMjNjMmE3MWJlZTE4ODM2NjMxNTU3ZDQ1ZGIy
|
14
|
+
MmY2NmUxNmRkNGU4NDMyZmI2MGI4Mjk2ZGRjODNjYzUxNjZhOTI4MDdkMWYz
|
15
|
+
Nzg2ZWY1MjYzNjkzNDVjMDc5MWUxY2I1NmMwNjQ4ZmIzYjdjYzE=
|
@@ -1,6 +1,7 @@
|
|
1
1
|
require "logger"
|
2
2
|
require "concurrent"
|
3
3
|
require "net/http"
|
4
|
+
require "rest-client"
|
4
5
|
|
5
6
|
module Sqspoller
|
6
7
|
|
@@ -21,17 +22,27 @@ module Sqspoller
|
|
21
22
|
@logger.info "Creating a new params hash"
|
22
23
|
params[key] = ( parsed_message[key].is_a?(Hash) ? parsed_message[key].to_json : parsed_message[key])
|
23
24
|
end
|
24
|
-
@logger.info "Got params as: #{params}"
|
25
|
+
@logger.info "rest-client, Got params as: #{params}"
|
26
|
+
|
27
|
+
|
25
28
|
if @http_method.downcase == "post"
|
26
|
-
|
29
|
+
RestClient::Request.execute(:method => :post, :url => @http_url, :payload => params.to_json, :timeout => 10, :open_timeout => 5) do |response, request, result|
|
30
|
+
process_http_response response
|
31
|
+
end
|
27
32
|
elsif @http_method.downcase == "get"
|
28
|
-
|
29
|
-
|
30
|
-
|
33
|
+
RestClient::Request.execute(:method => :get, :url => @http_url, :payload => params.to_json, :timeout => 10, :open_timeout => 5) do |response, request, result|
|
34
|
+
process_http_response response
|
35
|
+
end
|
31
36
|
else
|
32
37
|
raise "Invalid http_method provided. #{http_method}"
|
33
38
|
end
|
34
|
-
|
39
|
+
end
|
40
|
+
|
41
|
+
def process_http_response(response)
|
42
|
+
case response.code
|
43
|
+
when 200
|
44
|
+
return "OK"
|
45
|
+
else
|
35
46
|
raise "Service did not return 200 OK response. #{response.code}"
|
36
47
|
end
|
37
48
|
end
|
data/sqspoller.gemspec
CHANGED