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 'lib/api/files.rb')
-rw-r--r--lib/api/files.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/api/files.rb b/lib/api/files.rb
index 18638abd184..1850413caa6 100644
--- a/lib/api/files.rb
+++ b/lib/api/files.rb
@@ -49,13 +49,21 @@ module API
end
def content_sha
- Rails.cache.fetch("blob_content_sha256:#{user_project.full_path}:#{@blob.id}") do
+ cache_client.fetch("blob_content_sha256:#{user_project.full_path}:#{@blob.id}") do
@blob.load_all_data!
Digest::SHA256.hexdigest(@blob.data)
end
end
+ def cache_client
+ Gitlab::Cache::Client.build_with_metadata(
+ cache_identifier: 'API::Files#content_sha',
+ feature_category: :source_code_management,
+ backing_resource: :gitaly
+ )
+ end
+
def fetch_blame_range(blame_params)
return if blame_params[:range].blank?