Sha256: b9c858c6fd0c9d315164f7d334b0017d4f456b328eacc83dad1ae6c11b2b2e0c

Contents?: true

Size: 603 Bytes

Versions: 48

Compression:

Stored size: 603 Bytes

Contents

require 'cloud66_agent/utils/server'

module Cloud66
	module Commands
		class JobEnd
			def self.perform(job_uid, run_uid, run_status, run_time, results_file)
				run_data = File.exists?(results_file) ? IO.readlines(results_file) : []
				data = {
					run_uid: run_uid,
					run_status: run_status,
					run_time: run_time,
					run_data: run_data
				}
				Utils::Server.send_job_end(job_uid, data)
			rescue => exc
				$logger.error "Command \"job_end\" failed: #{exc.message}"
				exit -1
			ensure
				# get rid of the old results
				FileUtils.rm_rf(results_file) rescue nil
			end

		end
	end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
cloud66_agent-1.4.5 lib/cloud66_agent/commands/job_end.rb
cloud66_agent-1.4.4 lib/cloud66_agent/commands/job_end.rb
cloud66_agent-1.4.3 lib/cloud66_agent/commands/job_end.rb
cloud66_agent-1.4.2 lib/cloud66_agent/commands/job_end.rb
cloud66_agent-1.4.1 lib/cloud66_agent/commands/job_end.rb
cloud66_agent-1.4.0 lib/cloud66_agent/commands/job_end.rb
cloud66_agent-1.3.1 lib/cloud66_agent/commands/job_end.rb
cloud66_agent-1.3.0 lib/cloud66_agent/commands/job_end.rb
cloud66_agent-1.2.8 lib/cloud66_agent/commands/job_end.rb
cloud66_agent-1.2.7 lib/cloud66_agent/commands/job_end.rb
cloud66_agent-1.2.6 lib/cloud66_agent/commands/job_end.rb
cloud66_agent-1.2.5 lib/cloud66_agent/commands/job_end.rb
cloud66_agent-1.2.5.beta2 lib/cloud66_agent/commands/job_end.rb
cloud66_agent-1.2.5.beta1 lib/cloud66_agent/commands/job_end.rb
cloud66_agent-1.2.4 lib/cloud66_agent/commands/job_end.rb
cloud66_agent-1.2.4.beta1 lib/cloud66_agent/commands/job_end.rb
cloud66_agent-1.2.3 lib/cloud66_agent/commands/job_end.rb
cloud66_agent-1.2.2 lib/cloud66_agent/commands/job_end.rb
cloud66_agent-1.2.1 lib/cloud66_agent/commands/job_end.rb
cloud66_agent-1.2.1.beta1 lib/cloud66_agent/commands/job_end.rb