Sha256: 88b1993456346f94c948699d7b4357c107ed8e29933fd953b2d21c8af2c5ee37
Contents?: true
Size: 932 Bytes
Versions: 25
Compression:
Stored size: 932 Bytes
Contents
require 'open3' module ForemanInventoryUpload module Async class ShellProcess < ::ApplicationJob def perform(instance_label) klass_name = self.class.name logger.debug("Starting #{klass_name} with label #{instance_label}") progress_output = ProgressOutput.register(instance_label) Open3.popen2e(env, command) do |_stdin, stdout_stderr, wait_thread| progress_output.status = "Running in pid #{wait_thread.pid}" stdout_stderr.each do |out_line| progress_output.write_line(out_line) end progress_output.status = wait_thread.value.to_s end logger.debug("Finished job #{klass_name} with label #{instance_label}") ensure progress_output.close end def command end def env {} end def logger Foreman::Logging.logger('background') end end end end
Version data entries
25 entries across 25 versions & 2 rubygems