gitlab-org--gitlab-foss/lib/gitlab/cache
Lin Jen-Shin 143fc48aba Add RequestStoreWrap to cache via RequestStore
I don't like the idea of `RequestStore` at all, because it's just a
global state which shouldn't be used at all. But we have a number of
places calling `ProtectedBranch.protected?` and `ProtectedTag.protected?`
in a loop for the same user, project, and ref whenever we're checking
against if the jobs for a given pipeline is accessible for a given user.
This means we're effectively making N queries for the same thing over
and over.

To properly fix this, we need to change how we check the permission,
and that could be a huge work. To solve this quickly, adding a cache
layer for the given request would be quite simple to do.

We're already doing this in Commit#author, and this is extending that
idea and make it generalized.
2017-07-17 23:24:46 +08:00
..
ci Support multiple Redis instances based on queue type 2017-07-11 03:35:47 +00:00
request_store_wrap.rb Add RequestStoreWrap to cache via RequestStore 2017-07-17 23:24:46 +08:00