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
17
# File 'app/controllers/kuroko2/executions_controller.rb', line 9

def destroy
  if @execution.try!(:pid)
    hostname = Kuroko2::Worker.executing(@execution.id).try!(:hostname) || ''
    # XXX: Store pid and hostname for compatibility
    Kuroko2::ProcessSignal.create!(pid: @execution.pid, hostname: hostname, execution_id: @execution.id)
  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