Commit 16b7a164 authored by Rémy Coutable's avatar Rémy Coutable

Merge remote-tracking branch 'origin/master' into 8-13-stable

parents 8a96910c 0a7678b5
...@@ -102,9 +102,19 @@ module Gitlab ...@@ -102,9 +102,19 @@ module Gitlab
def request(method, *args, &block) def request(method, *args, &block)
sleep rate_limit_sleep_time if rate_limit_exceed? sleep rate_limit_sleep_time if rate_limit_exceed?
data = api.send(method, *args, &block) data = api.send(method, *args)
return data unless data.is_a?(Array)
if block_given?
yield data 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 last_response = api.last_response
while last_response.rels[:next] 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