Class: Jobbr::DelayedJobsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/jobbr/delayed_jobs_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



5
6
7
8
# File 'app/controllers/jobbr/delayed_jobs_controller.rb', line 5

def create
  @job = DelayedJob.run_delayed_by_name(params[:job_name], params)
  render json: { id: @job.id }
end

#showObject



10
11
12
13
# File 'app/controllers/jobbr/delayed_jobs_controller.rb', line 10

def show
  job_run = Run.find(params[:id])
  render json: { status: job_run.status, result: job_run.result, progress: job_run.progress }
end