Sha256: 66d631e68936d886ef75de2a1af823a206a299b035a627db3ff0363fe8c24808
Contents?: true
Size: 1.16 KB
Versions: 1
Compression:
Stored size: 1.16 KB
Contents
require 'celluloid' module Buildbox class Monitor include Celluloid def initialize(build, access_token, api) @build = build @access_token = access_token @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(@access_token, @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
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
buildbox-0.7.beta1 | lib/buildbox/monitor.rb |