goodcheck 3.0.2 → 3.0.3

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
  SHA256:
3
- metadata.gz: a0c8afdfe31520eabbb82eeaa32910c656e6447d4f3e13dcfd0ff6f09eb9854c
4
- data.tar.gz: 361efc3d3596749d09d1c6abca0bea722e1523f55b6d0a01c9750b7a7b2608e3
3
+ metadata.gz: b382336bf78153607e3951bdafe7d819ebac80b080df118fcf3c2b15a25040db
4
+ data.tar.gz: b17ec056b4d49b70d777a90142b40dd4d17dcb50d9e5861f88cdb37c0eaeff0e
5
5
  SHA512:
6
- metadata.gz: 51d137db095bc967e0bd2add64b94fccb2d3684bff282dd4f32efd749d39f52669a3e8b7acd58fbf428c83ef274130607a6a457a94415ce8bb58e4213d79d121
7
- data.tar.gz: de13aa4b155e7fe583f48a49da717c80455132d8dde0691fd9ca2cf075d84c2edb6b228cb9aa8ce3eb7afc2b726e5d93e6a448fb7f7fec36255f84e02a07c832
6
+ metadata.gz: 5eaa08336a26a7adb83a0100dd48937395b11a3ee0da758a869940d0e741fa515c5eabc9bef9bf6f6eb1d39d69141014e5c64b0868594fb2bf983ccec7f203c9
7
+ data.tar.gz: 52a89b2342b9d6785d7ecfb847174d36cccba6bbd33c073520dcc4f65569a2579fb0879e59048aa41de8cd5cd00bc1b07c95784fe53f4b2ed2e1cb05417b4ff8
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## HEAD
4
4
 
5
+ ## 3.0.3 (2021-06-25)
6
+
7
+ * Fix HTTP GET retrying [#203](https://github.com/sider/goodcheck/pull/203)
8
+
5
9
  ## 3.0.2 (2021-06-23)
6
10
 
7
11
  * Retry importing on Net::OpenTimeout [#202](https://github.com/sider/goodcheck/pull/202)
@@ -25,10 +25,6 @@ module Goodcheck
25
25
  super("HTTP GET #{res.uri} => #{res.code} #{res.message}")
26
26
  @response = res
27
27
  end
28
-
29
- def error_response?
30
- response.is_a?(Net::HTTPClientError) || response.is_a?(Net::HTTPServerError)
31
- end
32
28
  end
33
29
 
34
30
  attr_reader :cache_path
@@ -145,13 +141,15 @@ module Goodcheck
145
141
  when Net::HTTPRedirection
146
142
  location = res['Location']
147
143
  http_get location, limit - 1
148
- else
144
+ when Net::HTTPClientError, Net::HTTPServerError
149
145
  raise HTTPGetError.new(res)
146
+ else
147
+ raise Error, "HTTP GET failed due to #{res.inspect}"
150
148
  end
151
149
  rescue Net::OpenTimeout, HTTPGetError => exn
152
- if retry_count < max_retry_count && exn.error_response?
150
+ if retry_count < max_retry_count
153
151
  retry_count += 1
154
- Goodcheck.logger.info "#{retry_count} retry HTTP GET #{exn.response.uri} due to '#{exn.response.code} #{exn.response.message}'..."
152
+ Goodcheck.logger.info "Retry ##{retry_count} - HTTP GET #{uri} due to #{exn.inspect}..."
155
153
  sleep 1
156
154
  retry
157
155
  else
@@ -1,3 +1,3 @@
1
1
  module Goodcheck
2
- VERSION = "3.0.2".freeze
2
+ VERSION = "3.0.3".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: goodcheck
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.2
4
+ version: 3.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sider Corporation
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-06-23 00:00:00.000000000 Z
11
+ date: 2021-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -209,7 +209,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
209
209
  - !ruby/object:Gem::Version
210
210
  version: '0'
211
211
  requirements: []
212
- rubygems_version: 3.2.20
212
+ rubygems_version: 3.2.21
213
213
  signing_key:
214
214
  specification_version: 4
215
215
  summary: Regexp based customizable linter.