director/lib/director/job_runner.rb
# Instantiates and performs director job.
# @param [Array] args Opaque list of job arguments that will be used to
#   instantiate the new job object.
# @return [void]
Instantiates and performs director job.
Instantiates and performs director job .
def perform_job(*args)
      @debug_logger.info("Creating job")
      job = @job_class.new(*args)
      Config.current_job = job
      job.task_id = @task.id
      job.task_checkpoint 
      run_checkpointing
      @debug_logger.info("Performing task: #{@task.id}")
      @task.state = :processing
      @task.timestamp = Time.now
      @task.checkpoint_time = Time.now
      @task.save
      result = job.perform
      @debug_logger.info("Done")
      finish_task(:done, result)
    rescue Bosh::Director::TaskCancelled => e
      log_exception(e)
      @debug_logger.info("Task #{@task.id} cancelled")
      finish_task(:cancelled, "task cancelled")
    rescue Exception => e
      log_exception(e)
      @debug_logger.error("#{e}\n#{e.backtrace.join("\n")}")
      finish_task(:error, e)
    end
def perform_job ( * args ) @debug_logger . info ( "Creating job" ) job = @job_class . new ( * args ) Config . current_job = job job . task_id = @task . id job . task_checkpoint run_checkpointing @debug_logger . info ( "Performing task: #{@task.id}" ) @task . state = :processing @task . timestamp = Time . now @task . checkpoint_time = Time . now @task . save result = job . perform @debug_logger . info ( "Done" ) finish_task ( :done , result ) rescue Bosh :: Director :: TaskCancelled => e log_exception ( e ) @debug_logger . info ( "Task #{@task.id} cancelled" ) finish_task ( :cancelled , "task cancelled" ) rescue Exception => e log_exception ( e ) @debug_logger . error ( "#{e}\n#{e.backtrace.join("\n")}" ) finish_task ( :error , e ) end
Instantiates and performs director job.
Instantiates and performs director job .
# cancelled in the queue?
None
void
args
args Opaque list of job arguments that will be used to instantiate the new job object.
args Opaque list of job arguments that will be used to instantiate the new job object .