fix no-tasks-todo -> success logic
authorTom Clegg <tom@clinicalfuture.com>
Sun, 17 Mar 2013 22:29:18 +0000 (15:29 -0700)
committerTom Clegg <tom@clinicalfuture.com>
Sun, 17 Mar 2013 22:29:18 +0000 (15:29 -0700)
script/dispatch_jobs.rb

index 7f93de375b8edb75580d45e821b5e2375fad8a0b..0eea8d57cc2d3a56d2f6c37638676648853f9a88 100755 (executable)
@@ -166,9 +166,6 @@ class Dispatcher
                   j[:job].reload
                   j[:job].update_attributes running: true
                 end
-              elsif taskid == '' and message.match /^status: .* 0 todo/
-                $stderr.puts "dispatch: noticed #{job_uuid} succeeded"
-                j[:success] = true
               elsif taskid == '' and (re = message.match /^outputkey (\S+)$/)
                 $stderr.puts "dispatch: noticed #{job_uuid} output #{re[1]}"
                 j[:output] = re[1]
@@ -198,6 +195,10 @@ class Dispatcher
                   j[:job].tasks_summary[:todo] = re[3].to_i
                   j[:job].save
                 end
+                if re[2].to_i == 0 and re[3].to_i == 0
+                  $stderr.puts "dispatch: noticed #{job_uuid} succeeded"
+                  j[:success] = true
+                end
               end
             end
           end