Skip to content
Snippets Groups Projects
Commit 60545cf9 authored by Stan Hu's avatar Stan Hu Committed by Ahmad Sherif
Browse files

Use only deltas in diffs when scanning the last commit for changes in the avatar to save memory

parent 3e3da221
No related branches found
No related tags found
No related merge requests found
......@@ -38,7 +38,7 @@ v 8.11.0 (unreleased)
- Make error pages responsive (Takuya Noguchi)
- Change requests_profiles resource constraint to catch virtually any file
- Reduce number of queries made for merge_requests/:id/diffs
- Speed up Commit#repo_changes
- Speed up and reduce memory usage of Commit#repo_changes and Repository#expire_avatar_cache
v 8.10.3 (unreleased)
- Fix hooks missing on imported GitLab projects
......
......@@ -372,7 +372,7 @@ def expire_avatar_cache(branch_name = nil, revision = nil)
# We don't want to flush the cache if the commit didn't actually make any
# changes to any of the possible avatar files.
if revision && commit = self.commit(revision)
return unless commit.diffs.
return unless commit.diffs(deltas_only: true).
any? { |diff| AVATAR_FILES.include?(diff.new_path) }
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment