summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-06-25 13:55:03 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-06-25 13:55:03 +0300
commitdc917552641f88defa77f3ac7d68312ccccd21c4 (patch)
tree718f27143486ec5d5a0723336ea3874252fd82db /app/models
parent367a5d1b32c154baea584c0ffe85253869bee415 (diff)
downloadgitlab-ce-dc917552641f88defa77f3ac7d68312ccccd21c4.tar.gz
Cache graph log
Diffstat (limited to 'app/models')
-rw-r--r--app/models/repository.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb
index daf176576ad..4b8dee4829b 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -61,6 +61,14 @@ class Repository
Rails.cache.delete(cache_key(:size))
Rails.cache.delete(cache_key(:branch_names))
Rails.cache.delete(cache_key(:tag_names))
+ Rails.cache.delete(cache_key(:graph_log))
+ end
+
+ def graph_log
+ Rails.cache.fetch(cache_key(:graph)) do
+ stats = Gitlab::Git::GitStats.new(raw, root_ref)
+ stats.parsed_log
+ end
end
def cache_key(type)