Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-03-15 21:11:11 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-03-15 21:11:11 +0300
commitf6b58d14904a1413a5442d13f361671e59ab3ded (patch)
tree5120b75e5d2bfa1773f9c5e431521afef652a8c4 /lib/gitlab/redis
parentce97c898865e06644ae9c04d5c3666775b9998cb (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/redis')
-rw-r--r--lib/gitlab/redis/rate_limiting.rb5
-rw-r--r--lib/gitlab/redis/repository_cache.rb5
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/gitlab/redis/rate_limiting.rb b/lib/gitlab/redis/rate_limiting.rb
index 3a9fb63a495..62ab00c2408 100644
--- a/lib/gitlab/redis/rate_limiting.rb
+++ b/lib/gitlab/redis/rate_limiting.rb
@@ -3,6 +3,9 @@
module Gitlab
module Redis
class RateLimiting < ::Gitlab::Redis::Wrapper
+ # We create a subclass only for the purpose of differentiating between different stores in cache metrics
+ RateLimitingStore = Class.new(ActiveSupport::Cache::RedisCacheStore)
+
class << self
# The data we store on RateLimiting used to be stored on Cache.
def config_fallback
@@ -10,7 +13,7 @@ module Gitlab
end
def cache_store
- @cache_store ||= ActiveSupport::Cache::RedisCacheStore.new(redis: pool, namespace: Cache::CACHE_NAMESPACE)
+ @cache_store ||= RateLimitingStore.new(redis: pool, namespace: Cache::CACHE_NAMESPACE)
end
private
diff --git a/lib/gitlab/redis/repository_cache.rb b/lib/gitlab/redis/repository_cache.rb
index d8d434ae062..966c6584aa5 100644
--- a/lib/gitlab/redis/repository_cache.rb
+++ b/lib/gitlab/redis/repository_cache.rb
@@ -3,6 +3,9 @@
module Gitlab
module Redis
class RepositoryCache < ::Gitlab::Redis::Wrapper
+ # We create a subclass only for the purpose of differentiating between different stores in cache metrics
+ RepositoryCacheStore = Class.new(ActiveSupport::Cache::RedisCacheStore)
+
class << self
# The data we store on RepositoryCache used to be stored on Cache.
def config_fallback
@@ -10,7 +13,7 @@ module Gitlab
end
def cache_store
- @cache_store ||= ActiveSupport::Cache::RedisCacheStore.new(
+ @cache_store ||= RepositoryCacheStore.new(
redis: pool,
compress: Gitlab::Utils.to_boolean(ENV.fetch('ENABLE_REDIS_CACHE_COMPRESSION', '1')),
namespace: Cache::CACHE_NAMESPACE,