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:
Diffstat (limited to 'app/services/protected_branches/cache_service.rb')
-rw-r--r--app/services/protected_branches/cache_service.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/app/services/protected_branches/cache_service.rb b/app/services/protected_branches/cache_service.rb
index 66ca549c508..af8c9ce74bb 100644
--- a/app/services/protected_branches/cache_service.rb
+++ b/app/services/protected_branches/cache_service.rb
@@ -66,13 +66,18 @@ module ProtectedBranches
log_error(
'class' => self.class.name,
'message' => "Cache mismatch '#{encoded_ref_name}': cached value: #{cached_value}, real value: #{real_value}",
- 'project_id' => @project.id,
- 'project_path' => @project.full_path
+ 'record_class' => project_or_group.class.name,
+ 'record_id' => project_or_group.id,
+ 'record_path' => project_or_group.full_path
)
end
def redis_key
- @redis_key ||= [CACHE_ROOT_KEY, @project.id].join(':')
+ @redis_key ||= if Feature.enabled?(:group_protected_branches)
+ [CACHE_ROOT_KEY, project_or_group.class.name, project_or_group.id].join(':')
+ else
+ [CACHE_ROOT_KEY, project_or_group.id].join(':')
+ end
end
def metrics