Sha256: 2cf3a62c85f4ce71fef8b2a49db8391c5cba14c0550b0bbc58ecb36316b791db

Contents?: true

Size: 1 KB

Versions: 10

Compression:

Stored size: 1 KB

Contents

class Kuroko2::ExecutionsController < Kuroko2::ApplicationController

  before_action :set_execution, only: %i(destroy)

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

  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

  private

  def set_execution
    @execution = Kuroko2::Execution.where(job_definition_id: execution_params[:job_definition_id], job_instance_id: execution_params[:job_instance_id], id: execution_params[:id]).take
  end

  def execution_params
    params.permit(:id, :job_definition_id, :job_instance_id)
  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
kuroko2-0.8.0 app/controllers/kuroko2/executions_controller.rb
kuroko2-0.7.0 app/controllers/kuroko2/executions_controller.rb
kuroko2-0.6.0 app/controllers/kuroko2/executions_controller.rb
kuroko2-0.5.2 app/controllers/kuroko2/executions_controller.rb
kuroko2-0.5.1 app/controllers/kuroko2/executions_controller.rb
kuroko2-0.5.0 app/controllers/kuroko2/executions_controller.rb
kuroko2-0.4.6 app/controllers/kuroko2/executions_controller.rb
kuroko2-0.4.5 app/controllers/kuroko2/executions_controller.rb
kuroko2-0.4.4 app/controllers/kuroko2/executions_controller.rb
kuroko2-0.4.3 app/controllers/kuroko2/executions_controller.rb