summaryrefslogtreecommitdiff
path: root/lib/gitlab/cache
diff options
context:
space:
mode:
authorMichael Kozono <mkozono@gmail.com>2018-09-20 15:40:15 -0700
committerMichael Kozono <mkozono@gmail.com>2018-09-24 12:11:27 -0700
commita54a5d9f39df505fe7c68e14c693553bd29bd725 (patch)
treee742f1ddda1caec321b3048032a011c70b784eaf /lib/gitlab/cache
parent22bf3848ef0e59fb7689bfeab3ba0d8079f1597e (diff)
downloadgitlab-ce-a54a5d9f39df505fe7c68e14c693553bd29bd725.tar.gz
Use `Gitlab::SafeRequestStore` in more places
Even if it doesn’t save lines of code, since people will tend to use code they’ve seen. And `SafeRequestStore` is safer since you don’t have to remember to check `RequestStore.active?`.
Diffstat (limited to 'lib/gitlab/cache')
-rw-r--r--lib/gitlab/cache/request_cache.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/gitlab/cache/request_cache.rb b/lib/gitlab/cache/request_cache.rb
index 671b8e7e1b1..b96e161a5b6 100644
--- a/lib/gitlab/cache/request_cache.rb
+++ b/lib/gitlab/cache/request_cache.rb
@@ -26,8 +26,8 @@ module Gitlab
define_method(method_name) do |*args|
store =
- if RequestStore.active?
- RequestStore.store
+ if Gitlab::SafeRequestStore.active?
+ Gitlab::SafeRequestStore.store
else
ivar_name = # ! and ? cannot be used as ivar name
"@cache_#{method_name.to_s.tr('!?', "\u2605\u2606")}"