summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-07-12 10:44:46 -0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-07-12 12:14:17 -0300
commit78a5de99e9686bce11ba386e5d59c3e8085e40be (patch)
tree55cddf5916a8c52c58f6967991593b0bfeb6dab8
parentbe9262dd951e056e832ec51f8b74a8cb7ce866b4 (diff)
downloadgitlab-ce-fix-gh-rate-limit.tar.gz
Memoize response from `has_rate_limit?` to avoid extra API callfix-gh-rate-limit
-rw-r--r--lib/gitlab/github_import/client.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/gitlab/github_import/client.rb b/lib/gitlab/github_import/client.rb
index f2e220fcb3e..084e514492c 100644
--- a/lib/gitlab/github_import/client.rb
+++ b/lib/gitlab/github_import/client.rb
@@ -86,7 +86,9 @@ module Gitlab
end
def has_rate_limit?
- rate_limit.present?
+ return @has_rate_limit if defined?(@has_rate_limit)
+
+ @has_rate_limit = rate_limit.present?
end
def rate_limit_exceed?