lib/resque/plugins/batch/batch_job_info.rb
# Process the msg sent from WorkerJobInfo
Process the msg sent from WorkerJobInfo
Process the msg sent from WorkerJobInfo
def process_job_msg(job_msg)
          msg = job_msg["msg"]
          data = job_msg["data"]
          if status == 'pending' && msg == 'begin'
            @status = 'running'
            @start_time = Time.now
          elsif (status == 'running' || status == 'unknown') && (msg == 'success' || msg == 'failure')
            @status = msg
            @result = data
            @duration = Time.now - @start_time
          elsif (status == 'running' || status == 'unknown') && msg == 'exception'
            @status = 'exception'
            @exception = data
            @duration = Time.now - @start_time
          elsif msg == "info"
            true
          elsif msg == "arrhythmia"
            @status = 'unknown'
            @duration = Time.now - @start_time
          else
            raise "State machine Error #{job_msg}"
          end
        end
def process_job_msg ( job_msg ) msg = job_msg [ "msg" ] data = job_msg [ "data" ] if status == 'pending' && msg == 'begin' @status = 'running' @start_time = Time . now elsif ( status == 'running' || status == 'unknown' ) && ( msg == 'success' || msg == 'failure' ) @status = msg @result = data @duration = Time . now - @start_time elsif ( status == 'running' || status == 'unknown' ) && msg == 'exception' @status = 'exception' @exception = data @duration = Time . now - @start_time elsif msg == "info" true elsif msg == "arrhythmia" @status = 'unknown' @duration = Time . now - @start_time else raise "State machine Error #{job_msg}" end end
Process the msg sent from WorkerJobInfo
Process the msg sent from WorkerJobInfo
# Ignore client defined messages
job_msg
<not_specific>