Provide NullStore for RequestStore
Currently whenever we use RequestStore, we first have to check if it is enabled so we don't accidentally cache things. We should provide some kind of "null store" object that acts like a noop when RequestStore is not enabled. Sketch from Slack:
module Gitlab
class NullRequestStore
def [](key)
end
def []=(key, value)
end
# etc
end
NULL_STORE = NullRequestStore.new
def request_store
if RequestStore.active?
RequestStore
else
NULL_STORE
end
end
end
Gitlab.request_store['foo'] = 'bar'