Sha256: 1f93229da461354215404d5263ee9b6a3ff7d5c7320921657c419adab4b1ca03
Contents?: true
Size: 1.03 KB
Versions: 7
Compression:
Stored size: 1.03 KB
Contents
require 'celluloid' module Buildbox class Monitor include Celluloid def initialize(build, api) @build = build @api = api end def monitor loop do if @build.started? # As the build can finish in between doing the update_build api_call # and checking to see if the build has finished, we make sure we use the # same finished_at timestamp throughout the entire method. finished_at = @build.finished_at updated_build = @api.update_build(@build, :started_at => @build.started_at, :finished_at => finished_at, :output => @build.output, :exit_status => @build.exit_status) if updated_build.state == 'canceled' && !@build.cancelling? Buildbox::Canceler.new(@build).async.cancel end break if finished_at end sleep 1 end end end end
Version data entries
7 entries across 7 versions & 1 rubygems