lib/relaton_iana/data_fetcher.rb in relaton-iana-1.14.0 vs lib/relaton_iana/data_fetcher.rb in relaton-iana-1.14.1
- old
+ new
@@ -49,9 +49,10 @@
resp = nil
until attempt > 3 || json["items"]
if attempt.positive?
t = resp.headers["x-ratelimit-reset"].to_i - Time.now.to_i
if t.positive?
+ t += 30
warn "Rate limit is reached. Retrying in #{t} sec."
sleep t
end
end
attempt += 1