Class: ProgressJob::ProgressController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/progress_job/progress_controller.rb

Instance Method Summary collapse

Instance Method Details

#progressObject



6
7
8
9
10
11
# File 'app/controllers/progress_job/progress_controller.rb', line 6

def progress
  @current_job = Delayed::Job.find(params[:job_id])
  percentage = current_job.current_progress / current_job.max_progress.to_f * 100
  @current_job[:percentage] = percentage
  render json: @current_job
end