diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-07-12 10:44:46 -0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-07-12 12:14:17 -0300 |
commit | 78a5de99e9686bce11ba386e5d59c3e8085e40be (patch) | |
tree | 55cddf5916a8c52c58f6967991593b0bfeb6dab8 /lib | |
parent | be9262dd951e056e832ec51f8b74a8cb7ce866b4 (diff) | |
download | gitlab-ce-fix-gh-rate-limit.tar.gz |
Memoize response from `has_rate_limit?` to avoid extra API callfix-gh-rate-limit
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/github_import/client.rb | 4 |
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? |