Module: CoreDelayedJobWorkersController

Includes:
CoreController
Defined in:
lib/app/controllers/concerns/core_delayed_job_workers_controller.rb

Overview

Manage access to delayed job workers

Instance Method Summary collapse

Instance Method Details

#delayed_job_workerObject

Fetch the required job by id



32
33
34
# File 'lib/app/controllers/concerns/core_delayed_job_workers_controller.rb', line 32

def delayed_job_worker
  @delayed_job_worker ||= Delayed::Jobs::Worker.find(params[:id])
end

#destroyObject

Destroy the selected delayed job worker



19
20
21
22
23
24
25
26
27
# File 'lib/app/controllers/concerns/core_delayed_job_workers_controller.rb', line 19

def destroy
  authorize! :manage, delayed_job_worker
  delayed_job_worker.destroy!
  flash.now[:info] = 'Delayed Job Worker has been destroyed'
  redirect_to index_path
rescue StandardError => error
  log_controller_error error, true
  redirect_to index_path
end

#indexObject

Show a list of workers currently in the system



11
12
13
14
# File 'lib/app/controllers/concerns/core_delayed_job_workers_controller.rb', line 11

def index
  authorize! :read, Delayed::Jobs::Worker
  @workers = Delayed::Jobs::Worker.all
end