We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ba4c392 commit 333c02aCopy full SHA for 333c02a
lib/gitlab/github_import/client.rb
@@ -102,9 +102,19 @@ def rate_limit_sleep_time
102
def request(method, *args, &block)
103
sleep rate_limit_sleep_time if rate_limit_exceed?
104
105
- data = api.send(method, *args, &block)
106
- yield data
+ data = api.send(method, *args)
+ return data unless data.is_a?(Array)
107
108
+ if block_given?
109
+ yield data
110
+ each_response_page(&block)
111
+ else
112
+ each_response_page { |page| data.concat(page) }
113
+ data
114
+ end
115
116
+
117
+ def each_response_page
118
last_response = api.last_response
119
120
while last_response.rels[:next]
0 commit comments