Memoize response from `has_rate_limit?` to avoid extra API call

parent be9262dd
...@@ -86,7 +86,9 @@ module Gitlab ...@@ -86,7 +86,9 @@ module Gitlab
end end
def has_rate_limit? def has_rate_limit?
rate_limit.present? return @has_rate_limit if defined?(@has_rate_limit)
@has_rate_limit = rate_limit.present?
end end
def rate_limit_exceed? def rate_limit_exceed?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment