diff --git a/lib/comfpile/artefact.rb b/lib/comfpile/artefact.rb index 6f4aa79..84c898d 100644 --- a/lib/comfpile/artefact.rb +++ b/lib/comfpile/artefact.rb @@ -206,6 +206,10 @@ module Comfpile end end + def done_with_steps? + @steps_done_ctr >= @steps.length + end + def state return :blocked unless waitlist_empty? return @exit_state unless @exit_state.nil? @@ -232,6 +236,8 @@ module Comfpile end private def mark_state_change(state, reason, abort: false) + return unless @exit_state.nil? + puts "#{@stage} #{target}: Reached state #{state}: #{reason}" @exit_state = state @reason = reason @@ -270,7 +276,7 @@ module Comfpile end @steps_done_ctr += 1 - succeed! "All done", abort: true if @steps_done_ctr >= @steps.length + succeed! "All done", abort: true if waitlist_empty? and done_with_steps? ensure @running = false