Commit 333c02a8 authored by Ahmad Sherif's avatar Ahmad Sherif
Browse files

Fix broken handling of certain calls in GitHub importer client

Closes #22998
parent 709ab15e8df7
......@@ -102,9 +102,19 @@ def rate_limit_sleep_time
def request(method, *args, &block)
sleep rate_limit_sleep_time if rate_limit_exceed?
data = api.send(method, *args, &block)
yield data
data = api.send(method, *args)
return data unless data.is_a?(Array)
if block_given?
yield data
each_response_page(&block)
else
each_response_page { |page| data.concat(page) }
data
end
end
def each_response_page
last_response = api.last_response
while last_response.rels[:next]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment