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/models/blob.rb')
-rw-r--r--app/models/blob.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/models/blob.rb b/app/models/blob.rb
index bb8c9345573..c69cd8ac9f4 100644
--- a/app/models/blob.rb
+++ b/app/models/blob.rb
@@ -94,8 +94,11 @@ class Blob < SimpleDelegator
end
def self.lazy(repository, commit_id, path, blob_size_limit: Gitlab::Git::Blob::MAX_DATA_DISPLAY_SIZE)
- BatchLoader.for([commit_id, path]).batch(key: [:repository_blobs, repository]) do |items, loader, args|
- args[:key].last.blobs_at(items, blob_size_limit: blob_size_limit).each do |blob|
+ key = [:repository_blobs, repository]
+ key << blob_size_limit if Feature.enabled?(:increase_diff_file_performance, repository.project)
+
+ BatchLoader.for([commit_id, path]).batch(key: key) do |items, loader, args|
+ args[:key].second.blobs_at(items, blob_size_limit: blob_size_limit).each do |blob|
loader.call([blob.commit_id, blob.path], blob) if blob
end
end