Class: DelayedJobUi::MainController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/delayed_job_ui/main_controller.rb

Instance Method Summary collapse

Instance Method Details

#destroyObject



15
16
17
18
19
# File 'app/controllers/delayed_job_ui/main_controller.rb', line 15

def destroy
  @job = Delayed::Job.find(params[:id])
  @job.destroy!
  redirect_to params[:return_url]
end

#invokeObject



3
4
5
6
7
8
9
10
11
12
13
# File 'app/controllers/delayed_job_ui/main_controller.rb', line 3

def invoke
  begin
  @job = Delayed::Job.find(params[:id])
  @job.invoke_job
  rescue => e
    failed_job(e)
  else
    @job.delete # if successful, destroy the job.
  end
  redirect_to params[:return_url]
end