diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-06-25 14:55:03 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-06-25 14:55:03 +0400 |
commit | dc917552641f88defa77f3ac7d68312ccccd21c4 (patch) | |
tree | 718f27143486ec5d5a0723336ea3874252fd82db /app/controllers/projects/graphs_controller.rb | |
parent | 367a5d1b32c154baea584c0ffe85253869bee415 (diff) |
Cache graph log
Diffstat (limited to 'app/controllers/projects/graphs_controller.rb')
-rw-r--r-- | app/controllers/projects/graphs_controller.rb | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/app/controllers/projects/graphs_controller.rb b/app/controllers/projects/graphs_controller.rb index 5ff330ba6ca..252d47d939e 100644 --- a/app/controllers/projects/graphs_controller.rb +++ b/app/controllers/projects/graphs_controller.rb @@ -8,10 +8,18 @@ class Projects::GraphsController < Projects::ApplicationController respond_to do |format| format.html format.js do - @repo = @project.repository - @stats = Gitlab::Git::GitStats.new(@repo.raw, @repo.root_ref) - @log = @stats.parsed_log.to_json rescue [] + fetch_graph end end end + + private + + def fetch_graph + @log = @project.repository.graph_log.to_json + @success = true + rescue => ex + @log = [] + @success = false + end end |