Basic delayed jobs queue display and rubocop fixes

This commit is contained in:
Andres Keskküla 2014-11-12 18:31:21 +02:00
parent c7b58d8b06
commit f4ebbbdc95
5 changed files with 36 additions and 5 deletions

View file

@ -0,0 +1,5 @@
class Admin::DelayedJobsController < AdminController
def index
@jobs = Delayed::Job.all
end
end

View file

@ -0,0 +1,24 @@
.row
.col-sm-12
%h2.text-center-xs= t('shared.jobs')
%hr
.row
.col-md-12
.table-responsive
%table.table.table-hover.table-bordered.table-condensed
%thead
%tr
%th{class: 'col-xs-2'}= t('shared.priority')
%th{class: 'col-xs-2'}= t('shared.attempts')
%th{class: 'col-xs-2'}= t('shared.last_error')
%th{class: 'col-xs-1'}= t('shared.run_at')
%th{class: 'col-xs-1'}= t('shared.created_at')
%tbody
- @jobs.each do |job|
%tr
%td= job.priority
%td= job.attempts
%td= job.last_error
%td= job.run_at
%td= job.created_at

View file

@ -47,6 +47,10 @@
%li
= link_to t('shared.domains_history'), admin_domain_versions_path
%li
= link_to t('shared.jobs'), admin_delayed_jobs_path
%ul.nav.navbar-nav.navbar-right
%li= link_to t('shared.log_out', user: current_user), '/logout'
/ /.nav-collapse

View file

@ -85,8 +85,8 @@ task deploy: :environment do
to :launch do
queue "mkdir -p #{deploy_to}/current/tmp; touch #{deploy_to}/current/tmp/restart.txt"
queue "RAILS_ENV=production bin/delayed_job stop"
queue "RAILS_ENV=production bin/delayed_job start"
queue 'RAILS_ENV=production bin/delayed_job stop'
queue 'RAILS_ENV=production bin/delayed_job start'
end
end
end

View file

@ -27,11 +27,9 @@ Rails.application.routes.draw do
resources :users
resources :epp_users
resources :contact_versions
resources :domain_versions
resources :contact_histories
resources :domain_histories
resources :delayed_jobs
root 'domains#index'