Commit 898d09a21ef3bf937d0b9379dd13c917b553e859
1 parent
d18e2bd5
Exists in
master
and in
4 other branches
Gitlab_meta to 3.1. Added workaround for 500 Redis error until it will be fixed
Showing
4 changed files
with
26 additions
and
13 deletions
Show diff stats
Gemfile
Gemfile.lock
| ... | ... | @@ -171,7 +171,7 @@ GEM |
| 171 | 171 | mime-types (~> 1.19) |
| 172 | 172 | pygments.rb (>= 0.2.13) |
| 173 | 173 | github-markup (0.7.4) |
| 174 | - gitlab_meta (3.0) | |
| 174 | + gitlab_meta (3.1) | |
| 175 | 175 | gitolite (1.1.0) |
| 176 | 176 | gratr19 (~> 0.4.4.1) |
| 177 | 177 | grit (~> 2.5.0) |
| ... | ... | @@ -465,7 +465,7 @@ DEPENDENCIES |
| 465 | 465 | git |
| 466 | 466 | github-linguist (~> 2.3.4) |
| 467 | 467 | github-markup (~> 0.7.4) |
| 468 | - gitlab_meta (= 3.0) | |
| 468 | + gitlab_meta (= 3.1) | |
| 469 | 469 | gitolite (= 1.1.0) |
| 470 | 470 | grack! |
| 471 | 471 | grape (~> 0.2.1) | ... | ... |
app/controllers/admin/dashboard_controller.rb
| 1 | 1 | class Admin::DashboardController < AdminController |
| 2 | 2 | def index |
| 3 | - @workers = Resque.workers | |
| 4 | - @pending_jobs = Resque.size(:post_receive) | |
| 5 | 3 | @projects = Project.order("created_at DESC").limit(10) |
| 6 | 4 | @users = User.order("created_at DESC").limit(10) |
| 5 | + | |
| 6 | + @resque_accessible = true | |
| 7 | + @workers = Resque.workers | |
| 8 | + @pending_jobs = Resque.size(:post_receive) | |
| 9 | + | |
| 10 | + rescue Redis::InheritedError | |
| 11 | + @resque_accessible = false | |
| 7 | 12 | end |
| 8 | 13 | end | ... | ... |
app/views/admin/dashboard/index.html.haml
| ... | ... | @@ -4,13 +4,21 @@ |
| 4 | 4 | %h5 |
| 5 | 5 | Resque Workers |
| 6 | 6 | .data.padded |
| 7 | - = link_to admin_resque_path do | |
| 8 | - %h1{class: @workers.present? ? "cgreen" : "cred"} | |
| 9 | - = @workers.count | |
| 10 | - %hr | |
| 11 | - %p | |
| 12 | - %strong{class: @pending_jobs > 0 ? "cred" : "cgreen"} | |
| 13 | - #{@pending_jobs} post receive jobs waiting | |
| 7 | + - if @resque_accessible | |
| 8 | + = link_to admin_resque_path do | |
| 9 | + %h1{class: @workers.present? ? "cgreen" : "cred"} | |
| 10 | + = @workers.count | |
| 11 | + %hr | |
| 12 | + %p | |
| 13 | + %strong{class: @pending_jobs > 0 ? "cred" : "cgreen"} | |
| 14 | + #{@pending_jobs} post receive jobs waiting | |
| 15 | + - else | |
| 16 | + = link_to admin_resque_path do | |
| 17 | + %h1.cdark ? | |
| 18 | + %hr | |
| 19 | + %p | |
| 20 | + %strong Resque status unknown | |
| 21 | + | |
| 14 | 22 | |
| 15 | 23 | .span4 |
| 16 | 24 | .ui-box |
| ... | ... | @@ -42,6 +50,6 @@ |
| 42 | 50 | %hr |
| 43 | 51 | - @users.each do |user| |
| 44 | 52 | %p |
| 45 | - = link_to [:admin, user] do | |
| 53 | + = link_to [:admin, user] do | |
| 46 | 54 | = user.name |
| 47 | 55 | %small= user.email | ... | ... |