staccato-rack 0.4.0 → 0.4.1
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 +8 -8
- data/lib/staccato/rack/faraday_http_adapter.rb +16 -6
- data/lib/staccato/rack/version.rb +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
|
+
ZjYyNzQyNWJkYTE4YTA1YWZkZmQ0NTkyM2E5ZmUxYmI0YmNhZDkxYg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZjVmMzZiMDA4Zjg5NjViODkxNDA4ZjdiYWRiOTI2ODI2NjUzMWQ3OA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZWM0NTQwNDdhNGYzMmMxOTE3ZTUxYmQzOTNmZDdlNjkzOGY5YTI3MjZiNDRl
|
10
|
+
Yzk0NmNjOGMwYjBiZDJmNjgxYmNmZDJiZTI1OTVjMzhkOTU4ZWVkMTExYTky
|
11
|
+
NjU1NDk3NDAwMmQwZmY0YzQ0NzIwNDVmNmZlNThhZjQyMjg2ZDU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MmZiMjhkZGUwYWI3ZTI1Yzc1YTdhM2U0ZjJjOTI1Yzg2Y2QyYjUwZTdiMTE5
|
14
|
+
MjJkMWMwNGJlNjdjMTNlMTVmM2VjYmIzY2FjNzYxY2JkODBlOWZkOGMyYTA3
|
15
|
+
MzgzNDU2ZmJiMjhjYzk5ZTQ2ZjI5NzM4MzBhNjRmZDMwZDAwNzU=
|
@@ -13,15 +13,25 @@ module Staccato
|
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
-
def post(data)
|
17
|
-
Thread.new(data) do
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
16
|
+
def post(data, url = '/collect')
|
17
|
+
Thread.new(data, url) do
|
18
|
+
begin
|
19
|
+
execute(data, url)
|
20
|
+
rescue => e
|
21
|
+
@logger.error "Could not collect #{data.inspect} => #{e.message}"
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
def execute(post_data, post_url)
|
29
|
+
@conn.post do |req|
|
30
|
+
req.url post_url
|
31
|
+
req.options.timeout = 2 # open/read timeout in seconds
|
32
|
+
req.body = post_data
|
33
|
+
end
|
34
|
+
end
|
25
35
|
end
|
26
36
|
end
|
27
37
|
end
|