Commit graph

4 commits

Author SHA1 Message Date
Michael Kozono
3640292bf2 Cache Repository#exists? false in RequestStore
* Only truthy values are cached in Redis.
* All values are cached in RequestStore and in an instance variable.
2018-09-27 18:22:37 -07:00
Michael Kozono
d9c4ebc5a0 Extract Repository.memoize_method method
And reuse `Gitlab::Utils::StrongMemoize`.

There is a subtle behavior change required to reuse StrongMemoize in
this case. The early fallback check now occurs *before* reading the
memoized value instead of after.

I think this is fine since a memoized value should only exist if
`exists?` is also already memoized as `true`.
2018-09-27 15:16:09 -07:00
Imre Farkas
d4d6528c86
Expire correct method caches after HEAD changed 2018-06-29 17:41:57 +02:00
Alejandro Rodríguez
5171e2f3d4 Refactor RepositoryCache to make it usable in other classes 2018-03-06 21:12:29 -03:00