Commit e1811316 authored by Stan Hu's avatar Stan Hu
Browse files

Remove repository graph log to fix slow cache updates after push event

Recalculating graph_log took minutes on a large repository since each
of the 6000 commits would need to calculate the diff. Since graph_log
does not appear to be used, remove it from the list of things to update.
For the Linux kernel repository, this reduced the ProjectCacheWorker time
from 8+ minutes to 16 seconds.

Closes #2016
parent 84beb9b56a38
Please view this file on the master branch, on stable branches it's out of date.
v 7.14.0 (unreleased)
- Remove repository graph log to fix slow cache updates after push event (Stan Hu)
- Fix label read access for unauthenticated users (Daniel Gerhardt)
- Fix OAuth provider bug where GitLab would not go return to the redirect_uri after sign-in (Stan Hu)
- Fix file upload dialog for comment editing (Daniel Gerhardt)
......
......@@ -119,7 +119,7 @@ def size
end
def cache_keys
%i(size branch_names tag_names commit_count graph_log
%i(size branch_names tag_names commit_count
readme version contribution_guide changelog license)
end
......@@ -144,24 +144,6 @@ def rebuild_cache
end
end
def graph_log
cache.fetch(:graph_log) do
commits = raw_repository.log(limit: 6000, skip_merges: true,
ref: root_ref)
commits.map do |rugged_commit|
commit = Gitlab::Git::Commit.new(rugged_commit)
{
author_name: commit.author_name,
author_email: commit.author_email,
additions: commit.stats.additions,
deletions: commit.stats.deletions,
}
end
end
end
def lookup_cache
@lookup_cache ||= {}
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment