app/models/resque_instance.rb
# Return all jobs that are currently running as an array of `RunningJob` instances
Return all jobs that are currently running as an array of `RunningJob` instances
Return all jobs that are currently running as an array of ` RunningJob ` instances
def jobs_running
    worker_ids = Array(@resque_data_store.worker_ids)
    return [] if worker_ids.empty?
    workers_map(worker_ids).reject { |_,worker_info| worker_info.nil?  }.map { |resque_key,worker_info| 
      start_time = WorkerStartTime.new(worker_info,@stale_worker_seconds)
      worker_id = resque_key.gsub(/^worker:/,'')
      RunningJob.new(worker: worker_id,
                    payload: worker_info["payload"],
                 started_at: start_time.started_at,
                   too_long: start_time.too_long?,
                      queue: worker_info["queue"])
    }
  end
def jobs_running worker_ids = Array ( @resque_data_store . worker_ids ) return [ ] if worker_ids . empty? workers_map ( worker_ids ) . reject { | _ , worker_info | worker_info . nil? } . map { | resque_key , worker_info | start_time = WorkerStartTime . new ( worker_info , @stale_worker_seconds ) worker_id = resque_key . gsub ( / ^worker: / , '' ) RunningJob . new ( worker : worker_id , payload : worker_info [ "payload" ] , started_at : start_time . started_at , too_long : start_time . too_long? , queue : worker_info [ "queue" ] ) } end
Return all jobs that are currently running as an array of `RunningJob` instances
Return all jobs that are currently running as an array of ` RunningJob ` instances