diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2012-11-21 12:45:15 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2012-11-21 12:45:15 +0200 |
commit | 898d09a21ef3bf937d0b9379dd13c917b553e859 (patch) | |
tree | 437854e16263a4f167acb18077b30ffbf2db0eee | |
parent | d18e2bd59d3003e2ae38116688e350bfc2774ae7 (diff) | |
download | gitlab-ce-898d09a21ef3bf937d0b9379dd13c917b553e859.tar.gz |
Gitlab_meta to 3.1. Added workaround for 500 Redis error until it will be fixed
-rw-r--r-- | Gemfile | 2 | ||||
-rw-r--r-- | Gemfile.lock | 4 | ||||
-rw-r--r-- | app/controllers/admin/dashboard_controller.rb | 9 | ||||
-rw-r--r-- | app/views/admin/dashboard/index.html.haml | 24 |
4 files changed, 26 insertions, 13 deletions
@@ -152,5 +152,5 @@ group :test do end group :production do - gem "gitlab_meta", '3.0' + gem "gitlab_meta", '3.1' end diff --git a/Gemfile.lock b/Gemfile.lock index d5be48d1c7d..0e3a9810dbe 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -171,7 +171,7 @@ GEM mime-types (~> 1.19) pygments.rb (>= 0.2.13) github-markup (0.7.4) - gitlab_meta (3.0) + gitlab_meta (3.1) gitolite (1.1.0) gratr19 (~> 0.4.4.1) grit (~> 2.5.0) @@ -465,7 +465,7 @@ DEPENDENCIES git github-linguist (~> 2.3.4) github-markup (~> 0.7.4) - gitlab_meta (= 3.0) + gitlab_meta (= 3.1) gitolite (= 1.1.0) grack! grape (~> 0.2.1) diff --git a/app/controllers/admin/dashboard_controller.rb b/app/controllers/admin/dashboard_controller.rb index 5152f6fa83d..827dd0cf7cd 100644 --- a/app/controllers/admin/dashboard_controller.rb +++ b/app/controllers/admin/dashboard_controller.rb @@ -1,8 +1,13 @@ class Admin::DashboardController < AdminController def index - @workers = Resque.workers - @pending_jobs = Resque.size(:post_receive) @projects = Project.order("created_at DESC").limit(10) @users = User.order("created_at DESC").limit(10) + + @resque_accessible = true + @workers = Resque.workers + @pending_jobs = Resque.size(:post_receive) + + rescue Redis::InheritedError + @resque_accessible = false end end diff --git a/app/views/admin/dashboard/index.html.haml b/app/views/admin/dashboard/index.html.haml index 3e26f566a2e..b0b59a46fdb 100644 --- a/app/views/admin/dashboard/index.html.haml +++ b/app/views/admin/dashboard/index.html.haml @@ -4,13 +4,21 @@ %h5 Resque Workers .data.padded - = link_to admin_resque_path do - %h1{class: @workers.present? ? "cgreen" : "cred"} - = @workers.count - %hr - %p - %strong{class: @pending_jobs > 0 ? "cred" : "cgreen"} - #{@pending_jobs} post receive jobs waiting + - if @resque_accessible + = link_to admin_resque_path do + %h1{class: @workers.present? ? "cgreen" : "cred"} + = @workers.count + %hr + %p + %strong{class: @pending_jobs > 0 ? "cred" : "cgreen"} + #{@pending_jobs} post receive jobs waiting + - else + = link_to admin_resque_path do + %h1.cdark ? + %hr + %p + %strong Resque status unknown + .span4 .ui-box @@ -42,6 +50,6 @@ %hr - @users.each do |user| %p - = link_to [:admin, user] do + = link_to [:admin, user] do = user.name %small= user.email |