Sha256: 6959fe68c3e6a4e73de6964fa9cdeddd8cf3dc910d5495a26bd230e424d3df06
Contents?: true
Size: 1.14 KB
Versions: 7
Compression:
Stored size: 1.14 KB
Contents
module ForemanInventoryUpload class StatusesController < ::ApplicationController # override default "welcome screen behavior, since we don't have a model" def welcome true end def index portal_users = RedhatAccess::TelemetryConfiguration .where(enable_telemetry: true) .distinct .pluck(:portal_user) statuses = Hash[ portal_users.map do |portal_user| generate_report_status = status_for(portal_user, ForemanInventoryUpload::Async::GenerateReportJob) upload_report_status = status_for(portal_user, ForemanInventoryUpload::Async::UploadReportJob) [ portal_user, { generate_report_status: generate_report_status, upload_report_status: upload_report_status, }, ] end ] render json: { statuses: statuses, }, status: :ok end private def status_for(portal_user, job_class) label = job_class.output_label(portal_user) ForemanInventoryUpload::Async::ProgressOutput.get(label)&.status end end end
Version data entries
7 entries across 7 versions & 1 rubygems