relaton-iana 1.12.4 → 1.12.5

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: 000e88f14c8ea63fb6272d0bd2ec08b1c58421d0742c68361207ab046d2a0de4
4
- data.tar.gz: 4c8d35a3eb5fd824a66e1f21654a9cd6b09d23dd638c883f9bb799fea7b7b580
3
+ metadata.gz: f252aaed0f38fd807bb42f46e68e6711a550d3ae3bedf8b3c1d5be678de559fb
4
+ data.tar.gz: e330cfa8122d9248b251826e4384e13f8980c7006bfc6dfd4e51ff849747d12b
5
5
  SHA512:
6
- metadata.gz: b291d8a9ae54560d55f9c68d2310fddbd76c8e0bb547a728379b7217bcbe06b2401d30869987e97f4173668d4b8c4f7da889fc0796ff7b9e46cd37389580ca69
7
- data.tar.gz: feece0d34118c64f01562e387a5f892a9c8ba85e1ef778a8a14ace9f2d7eaf88405e1f8c61108dfc954e8b231d030f58d1e5c8180536ff987c5ac486f25c9bda
6
+ metadata.gz: 2f9f6474c8a94b2a4f7f13a65a7bcf4fa16ccdd13d86623b8eecf42f719d2f6f69feb0daf448a8aa65a1f0a9819498a5b23a880a4de3b057d88114ac54f55e98
7
+ data.tar.gz: 186707bedaa38b15cd2bdd0d53ed0c498c0b2815135f169ac432a7460cb397e488c7c1fc0613cec7cc8b44c565d55fb37004e346d9bf4a6f1d7867720f839c2e
@@ -46,10 +46,14 @@ module RelatonIana
46
46
  end
47
47
  attempt = 0
48
48
  json = {}
49
+ resp = nil
49
50
  until attempt > 3 || json["items"]
50
51
  if attempt.positive?
51
- warn "Rate limit is reached. Retrying in 30 sec."
52
- sleep 30
52
+ t = resp.headers["x-ratelimit-reset"].to_i - Time.now.to_i
53
+ if t.positive?
54
+ warn "Rate limit is reached. Retrying in #{t} sec."
55
+ sleep t
56
+ end
53
57
  end
54
58
  attempt += 1
55
59
  resp = Faraday.get "https://api.github.com/search/code", params, headers
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RelatonIana
4
- VERSION = "1.12.4"
4
+ VERSION = "1.12.5"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-iana
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.12.4
4
+ version: 1.12.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-08-10 00:00:00.000000000 Z
11
+ date: 2022-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: equivalent-xml