Sha256: 7e075af0e593b47219de3123cc61fcb7ced07b47714d5ef49d4588390bc48f29
Contents?: true
Size: 863 Bytes
Versions: 51
Compression:
Stored size: 863 Bytes
Contents
module ForemanInventoryUpload module Async class ProgressOutput def self.get(label) ProgressOutput.new(label, :reader) end def self.register(label) TaskOutputLine.where(label: @label).delete_all ProgressOutput.new(label, :writer) end def initialize(label, mode) @label = label @mode = mode end def full_output TaskOutputLine.where(label: @label).order(:created_at).pluck(:line).join("\n") end def write_line(line) TaskOutputLine.create!(label: @label, line: line) end def close end def status TaskOutputStatus.where(label: @label).pluck(:status).first || '' end def status=(status) TaskOutputStatus.upsert({ label: @label, status: status }, unique_by: :label) end end end end
Version data entries
51 entries across 51 versions & 1 rubygems