Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-07-11 22:15:59 +0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-07-12 18:14:17 +0300
commit38a58978aa7969908ef31f2eac99138da2be869b (patch)
tree83ee2ad1c9fca0d568e84436333e367b6145d1bc /lib
parent158786caae7d025b2797008926cfd7d519367b87 (diff)
Fix GItHub client requests when rate limit is disabled
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/github_import/client.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/gitlab/github_import/client.rb b/lib/gitlab/github_import/client.rb
index 043f10d96a9..f57f5b74706 100644
--- a/lib/gitlab/github_import/client.rb
+++ b/lib/gitlab/github_import/client.rb
@@ -78,6 +78,11 @@ module Gitlab
def rate_limit
api.rate_limit!
+ # GitHub Rate Limit API returns 404 when the rate limit is
+ # disabled. In this case we just want to return gracefully
+ # instead of spitting out an error.
+ rescue Octokit::NotFound
+ OpenStruct.new(remaining: GITHUB_SAFE_REMAINING_REQUESTS + 1)
end
def rate_limit_exceed?