moretodo = false
@components.each do |cname, c|
job = nil
+ # Is the job satisfying this component already known to be
+ # finished? (Already meaning "before we query API server about
+ # the job's current state")
c_already_finished = (c[:job] &&
c[:job][:uuid] &&
!c[:job][:success].nil?)
if (c[:job][:running] or
not (c[:job][:finished_at] or c[:job][:cancelled_at]))
# Job is running so update copy of job record
- c[:job] = JobCache.get(c[:job][:uuid])
+ c[:job] = JobCache.get(c[:job][:uuid])
end
if c[:job][:success]
end
end
unless c_already_finished
+ # This is my first time discovering that the job
+ # succeeded. (At the top of this loop, I was still
+ # waiting for it to finish.)
if c[:output_is_persistent]
- # This is my first time discovering that the job
- # succeeded. I need to make sure a resources/wants
- # link is in place to protect the output from garbage
+ # I need to make sure a resources/wants link is in
+ # place to protect the output from garbage
# collection. (Normally Crunch does this for me, but
# here I might be reusing the output of someone else's
# job and I need to make sure it's understood that the
end
end
end
-
+
if ended == @components.length or failed > 0
@instance[:active] = false
@instance[:success] = (succeeded == @components.length)