Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
8c2610a268ec
Commit
333c02a8
authored
Oct 05, 2016
by
Ahmad Sherif
Browse files
Fix broken handling of certain calls in GitHub importer client
Closes #22998
parent
709ab15e8df7
Changes
1
Show whitespace changes
Inline
Side-by-side
lib/gitlab/github_import/client.rb
View file @
8c2610a2
...
...
@@ -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
)
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
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment