fix: 🩹 fix erroneous success! setting when steps done but waitlist full

This commit is contained in:
David Bailey 2023-04-13 09:52:00 +02:00
parent 120c420f30
commit 493c04ac45

View file

@ -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