Class: Admin::JobsController
- Inherits:
-
BaseController
- Object
- BaseController
- Admin::JobsController
- Defined in:
- app/controllers/admin/jobs_controller.rb
Instance Method Summary collapse
Instance Method Details
#destroy ⇒ Object
12 13 14 15 16 17 |
# File 'app/controllers/admin/jobs_controller.rb', line 12 def destroy if @job = Delayed::Job.find_by_id(params[:id]) @job.destroy end redirect_to admin_jobs_path, :notice => "Job deleted" end |
#index ⇒ Object
4 5 6 |
# File 'app/controllers/admin/jobs_controller.rb', line 4 def index @jobs = Delayed::Job.order(:run_at) end |
#retry ⇒ Object
19 20 21 22 23 24 |
# File 'app/controllers/admin/jobs_controller.rb', line 19 def retry if @job = Delayed::Job.find_by_id(params[:id]) @job.update_columns(attempts: 0, run_at: Time.now, failed_at: nil) end redirect_to admin_jobs_path, :notice => "Job will be retried" end |
#show ⇒ Object
8 9 10 |
# File 'app/controllers/admin/jobs_controller.rb', line 8 def show @job = Delayed::Job.find(params[:id]) end |