module RocketJobMissionControl class ActiveProcessesController < RocketJobMissionControl::ApplicationController def index # The list of workers actively processing jobs # [Array[Array 'running') do |slice| busy << {worker_name: slice.worker_name, klass: job.class.name, description: job.description, started_at: slice.started_at, id: job.id} end elsif job.running? busy << {worker_name: job.worker_name, klass: job.class.name, description: job.description, started_at: job.started_at, id: job.id} end end @busy = sorted ? busy : busy.sort_by { |h| h[:worker_name] } respond_to do |format| format.html format.json { render(json: ActiveProcessesDatatable.new(view_context, @busy)) } end end end end