Commit Graph

15 Commits

Author SHA1 Message Date
GitLab Bot 43e3dc2f95 Add latest changes from gitlab-org/gitlab@master 2020-02-12 18:09:21 +00:00
GitLab Bot 7b25b12016 Add latest changes from gitlab-org/gitlab@master 2019-11-04 18:06:28 +00:00
GitLab Bot 0f0a8be306 Add latest changes from gitlab-org/gitlab@master 2019-10-30 21:07:58 +00:00
Nick Thomas 4cd6c91d5f
Redis set cache docs and minor cleanup 2019-09-10 14:09:55 +01:00
Nick Thomas 07323f44b7
Revert "Revert "Cache branch and tag names as Redis sets""
This reverts commit c6ccc07f48.
2019-09-10 13:45:21 +01:00
Nick Thomas c6ccc07f48
Revert "Cache branch and tag names as Redis sets"
This reverts commit 0eff75fa2b.
2019-08-29 18:04:52 +01:00
Nick Thomas 0eff75fa2b
Cache branch and tag names as Redis sets
This allows us to check inclusion for the *_exists? methods without
downloading the full list of branch names, which is over 100KiB in size
for gitlab-ce at the moment.
2019-08-16 15:41:29 +01:00
Mayra Cabrera 0ab89d8e36 Add a rubocop for Rails.logger
Suggests to use a JSON structured log instead

Related to https://gitlab.com/gitlab-org/gitlab-ce/issues/54102
2019-07-10 19:26:47 +00:00
gfyoung c858f70d07 Enable frozen string for lib/gitlab/*.rb 2018-10-22 07:00:50 +00:00
Michael Kozono f2fa7c10c8 Remove send-in-send for safety and readability
I attempted to refactor so that the caller of `wrap_method` passes in a
block, rather than a method name, but I was unsuccessful.

I kept getting the following error:

NoMethodError:
        undefined method `cache_method_output' for Repository:Class

If you can figure this out, then feel free to dry up these class methods
again without doing a send-within-a-send.
2018-09-27 18:22:37 -07:00
Michael Kozono 87a1ba1488 Expire RequestStore cache properly 2018-09-27 18:22:37 -07:00
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