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:
authorStan Hu <stanhu@gmail.com>2015-07-20 08:53:14 +0300
committerStan Hu <stanhu@gmail.com>2015-07-20 08:53:14 +0300
commite1811316d73ea0b240d7f47e1de557b712ed4cee (patch)
tree4ea24663235b49658f666288dbbbdabadd7ef030 /app/models
parente5a12596abe48504737cb8633872794aa83ccb32 (diff)
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
Diffstat (limited to 'app/models')
-rw-r--r--app/models/repository.rb20
1 files changed, 1 insertions, 19 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb
index 1d208aa71c4..807b33b2a3e 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -119,7 +119,7 @@ class Repository
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 @@ class Repository
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