heartcheck-webservice 1.3.1 → 2.0.0

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: e15d2e40ecc6dea0cc7c53bcd02df13483dabfa0
4
- data.tar.gz: bb821b7b6edb4c2360f60a81e2ba0b1953372b34
3
+ metadata.gz: 69c81f0a8ea88221f9db52b9d8eca7a053493bce
4
+ data.tar.gz: 294c766bb22999f1b0af0452b6e49011d5c2fd1c
5
5
  SHA512:
6
- metadata.gz: 97820e4735c35581864538bd205888233200e2e261256d8d8cfda6c5da34c5ec0719149a44a29433e132bb492e73f097c78c890daaaccc5ffbad6240c9eefde0
7
- data.tar.gz: 4edeb1b4ede096005656422b3fbe8add4e883dad3e1197639a915576e75560d8604f1537162dc92129a0387eb896a9b469cef4292182570bdc681d7aaff17127
6
+ metadata.gz: 404d88d5fb1c734c367a680579d3307bcfc50daf337ca7c524a15c1c6edbdeb6cffe1162679628b9c9c1ace864448b74b27e622df976e68f6f497fdebdfef580
7
+ data.tar.gz: 9316aa576f77a2e0f03ceed0625fa2bcc151e978d647829d81308e6e5cc463fd1e63e6ec77d42fc2c6fa9840ada3f34ade85c6e1d8637cd19a19c55c889ed2b0
@@ -14,6 +14,10 @@ module Heartcheck
14
14
 
15
15
  private
16
16
 
17
+ DEFAULT_OPEN_TIMEOUT = 3
18
+ DEFAULT_READ_TIMEOUT = 5
19
+ private_constant :DEFAULT_OPEN_TIMEOUT, :DEFAULT_READ_TIMEOUT
20
+
17
21
  # customize the error message
18
22
  # It's called in Heartcheck::Checks::Base#append_error
19
23
  #
@@ -79,12 +83,14 @@ module Heartcheck
79
83
  #
80
84
  # @return [Net:HTTP]
81
85
  def request_for(service)
82
- Heartcheck::Webservice::HttpClient.new(service[:url],
83
- service[:proxy],
84
- service[:ignore_ssl_cert],
85
- service[:headers],
86
- service[:open_timeout],
87
- service[:read_timeout]).get
86
+ Heartcheck::Webservice::HttpClient.new(
87
+ service[:url],
88
+ service[:proxy],
89
+ service[:ignore_ssl_cert],
90
+ service[:headers],
91
+ service.fetch(:open_timeout, DEFAULT_OPEN_TIMEOUT),
92
+ service.fetch(:read_timeout, DEFAULT_READ_TIMEOUT)
93
+ ).get
88
94
  end
89
95
  end
90
96
  end
@@ -2,6 +2,6 @@
2
2
  module Heartcheck
3
3
  # gem version
4
4
  module Webservice
5
- VERSION = '1.3.1'
5
+ VERSION = '2.0.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: heartcheck-webservice
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Locaweb
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-23 00:00:00.000000000 Z
11
+ date: 2017-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: heartcheck
@@ -175,7 +175,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
175
175
  version: '0'
176
176
  requirements: []
177
177
  rubyforge_project:
178
- rubygems_version: 2.6.11
178
+ rubygems_version: 2.6.13
179
179
  signing_key:
180
180
  specification_version: 4
181
181
  summary: A webservice checker.