xnm-telegram 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 +4 -4
- data/lib/xnm/telegram/HTTPCore.rb +7 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9ddabede26bf498e207b37db83c30acac27d6fbb4c8773bad9d11601493823e
|
4
|
+
data.tar.gz: 0bf434550615aa9155facc5bdae02c21a04891cd9f8b0d10b46af054c3af81c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7fffa3578156d66bc2b95ef25ee44ac960a7dda85482c5355594a08ee7b4d2327285767f99454e5d4f62b0214fce1c32eb43e7ba9405e493f929c181ca13fc99
|
7
|
+
data.tar.gz: f6871001ffe6f2603a4aa166aad77e2ca809c5384126163451f71f62665a9d8f8f32ef0cbf8581ac966d0de442dc9768a6592353e46c4a155c1d86266bfb9ba6
|
@@ -43,9 +43,11 @@ module Telegram
|
|
43
43
|
end
|
44
44
|
|
45
45
|
private def _raw_post(addr, data)
|
46
|
-
|
47
|
-
|
48
|
-
|
46
|
+
response = '';
|
47
|
+
|
48
|
+
IO.popen('curl', '-s', '-XPOST', '-HContent-Type: application/json', "-d#{data.to_json}", "#{addr}") do |resp|
|
49
|
+
response = resp.read
|
50
|
+
end
|
49
51
|
|
50
52
|
JSON.parse(response, symbolize_names: true)
|
51
53
|
end
|
@@ -61,10 +63,10 @@ module Telegram
|
|
61
63
|
# Rescue-construct to prevent a HTTP error from
|
62
64
|
# crashing our system.
|
63
65
|
timeoutLen = data[:timeout] if data.is_a? Hash
|
64
|
-
timeoutLen ||=
|
66
|
+
timeoutLen ||= 3;
|
65
67
|
retryCount = 0;
|
66
68
|
begin
|
67
|
-
Timeout.timeout(timeoutLen) do
|
69
|
+
Timeout.timeout(timeoutLen*1.3) do
|
68
70
|
return _raw_post(call_address, _double_json_data(data));
|
69
71
|
end
|
70
72
|
rescue
|