Class: Kuroko2::ExecutionsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/kuroko2/executions_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#current_user

Instance Method Details

#destroyObject



9
10
11
12
13
14
15
16
# File 'app/controllers/kuroko2/executions_controller.rb', line 9

def destroy
  if @execution.try(:pid)
    hostname = Kuroko2::Worker.executing(@execution.id).try(:hostname)
    Kuroko2::ProcessSignal.create!(pid: @execution.pid, hostname: hostname) if hostname
  end

  redirect_to job_definition_job_instance_path(job_definition_id: execution_params[:job_definition_id], id: execution_params[:job_instance_id])
end

#indexObject



5
6
7
# File 'app/controllers/kuroko2/executions_controller.rb', line 5

def index
  @executions = Kuroko2::Execution.where(finished_at: nil).order(created_at: :desc).includes(job_instance: :job_definition)
end