Sha256: 96a202407ffde1fb1982e45cb443c866679a45bef9af5f0717c273f5654f2c84
Contents?: true
Size: 711 Bytes
Versions: 6
Compression:
Stored size: 711 Bytes
Contents
module Sidekiq module Monitor module Api class QueuesController < ActionController::Base protect_from_forgery def show queue = params[:queue] render json: {}, status: 404 and return if queue.blank? status_counts = Sidekiq::Monitor::Job.where(queue: queue).count(group: 'status') ordered_status_counts = {} Job::STATUSES.each do |status| ordered_status_counts[status] = status_counts.has_key?(status) ? status_counts[status] : 0 end response = { status_counts: ordered_status_counts } render json: response.to_json, status: :ok end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems