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/reference_parser | |
| 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/reference_parser')
| -rw-r--r-- | lib/banzai/reference_parser/base_parser.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/banzai/reference_parser/base_parser.rb b/lib/banzai/reference_parser/base_parser.rb index 68752f5bb5a..3ab154a7b1c 100644 --- a/lib/banzai/reference_parser/base_parser.rb +++ b/lib/banzai/reference_parser/base_parser.rb @@ -166,7 +166,7 @@ module Banzai # objects that have not yet been queried. For objects that have already # been queried the object is returned from the cache. def collection_objects_for_ids(collection, ids) - if RequestStore.active? + if Gitlab::SafeRequestStore.active? ids = ids.map(&:to_i) cache = collection_cache[collection_cache_key(collection)] to_query = ids - cache.keys @@ -248,7 +248,7 @@ module Banzai end def collection_cache - RequestStore[:banzai_collection_cache] ||= Hash.new do |hash, key| + Gitlab::SafeRequestStore[:banzai_collection_cache] ||= Hash.new do |hash, key| hash[key] = {} end end |
