Skip to content

Commit 78a5de9

Browse files
committed
Memoize response from has_rate_limit? to avoid extra API call
1 parent be9262d commit 78a5de9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/gitlab/github_import/client.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ def rate_limit
8686
end
8787

8888
def has_rate_limit?
89-
rate_limit.present?
89+
return @has_rate_limit if defined?(@has_rate_limit)
90+
91+
@has_rate_limit = rate_limit.present?
9092
end
9193

9294
def rate_limit_exceed?

0 commit comments

Comments
 (0)