diff options
author | Michael Kozono <mkozono@gmail.com> | 2018-09-20 15:40:15 -0700 |
---|---|---|
committer | Michael Kozono <mkozono@gmail.com> | 2018-09-24 12:11:27 -0700 |
commit | a54a5d9f39df505fe7c68e14c693553bd29bd725 (patch) | |
tree | e742f1ddda1caec321b3048032a011c70b784eaf /lib/banzai/request_store_reference_cache.rb | |
parent | 22bf3848ef0e59fb7689bfeab3ba0d8079f1597e (diff) | |
download | gitlab-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/banzai/request_store_reference_cache.rb')
-rw-r--r-- | lib/banzai/request_store_reference_cache.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/banzai/request_store_reference_cache.rb b/lib/banzai/request_store_reference_cache.rb index 426131442a2..9a9704f9837 100644 --- a/lib/banzai/request_store_reference_cache.rb +++ b/lib/banzai/request_store_reference_cache.rb @@ -1,8 +1,8 @@ module Banzai module RequestStoreReferenceCache def cached_call(request_store_key, cache_key, path: []) - if RequestStore.active? - cache = RequestStore[request_store_key] ||= Hash.new do |hash, key| + if Gitlab::SafeRequestStore.active? + cache = Gitlab::SafeRequestStore[request_store_key] ||= Hash.new do |hash, key| hash[key] = Hash.new { |h, k| h[k] = {} } end |