diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-07-11 22:15:59 +0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-07-12 18:14:17 +0300 |
commit | 38a58978aa7969908ef31f2eac99138da2be869b (patch) | |
tree | 83ee2ad1c9fca0d568e84436333e367b6145d1bc /lib | |
parent | 158786caae7d025b2797008926cfd7d519367b87 (diff) |
Fix GItHub client requests when rate limit is disabled
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/github_import/client.rb | 5 |
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? |