diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2018-01-09 20:30:04 +0300 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2018-01-12 12:54:55 +0300 |
commit | 4f00a05152c105814f17a5f582d493435de96747 (patch) | |
tree | 76eab649b7c832afb47ad3e37ead6eb7a4bdaa93 /lib/gitlab/github_import | |
parent | 3fde958f36fa9c3bfa30ed1f73108e0640722926 (diff) |
Introduce PredicateMemoization cop and fix offenses
with StrongMemoize
Diffstat (limited to 'lib/gitlab/github_import')
-rw-r--r-- | lib/gitlab/github_import/client.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/gitlab/github_import/client.rb b/lib/gitlab/github_import/client.rb index 5da9befa08e..4f160e4a447 100644 --- a/lib/gitlab/github_import/client.rb +++ b/lib/gitlab/github_import/client.rb @@ -14,6 +14,8 @@ module Gitlab # puts label.name # end class Client + include ::Gitlab::Utils::StrongMemoize + attr_reader :octokit # A single page of data and the corresponding page number. @@ -173,7 +175,9 @@ module Gitlab end def rate_limiting_enabled? - @rate_limiting_enabled ||= api_endpoint.include?('.github.com') + strong_memoize(:rate_limiting_enabled) do + api_endpoint.include?('.github.com') + end end def api_endpoint |