]> mj.ucw.cz Git - bex.git/blobdiff - brun
TODO
[bex.git] / brun
diff --git a/brun b/brun
index 42bdf86b4e07b984632eaaca1de53417abb6040d..040b6ba40d66d6abc9f83bd8b00401062a76e069 100755 (executable)
--- a/brun
+++ b/brun
@@ -38,7 +38,7 @@ sub update_status($$$$;$) {
                print $status_fd "! $mach $job $status\n";
        }
        if ($log_on_queue) {
-               $log_on_queue->log($mach, $job, $status, $msg);
+               $log_on_queue->update_job_status($mach, $job, $status, $msg);
        }
 }
 
@@ -167,23 +167,14 @@ for my $mach (@machines) {
                        $jid eq $given_job or next;
                }
                my $job = BEX::Job->new_from_file($queue->job_file($jid));
+               update_status($mach, $jid, 'INIT', undef);
                if (!$queue->lock($mach, $jid)) {
                        print "### Skipping locked $jid on $mach ###\n";
                        update_status($mach, $jid, 'LOCKED', undef);
                        next;
                }
-               my $stat = {
-                       'Time' => time,
-               };
                print "### Running ", $job->name, " on $mach ###\n";
                my ($s, $msg) = run_job($job, $queue, $mach);
-
-               $stat->{'Status'} = $s;
-               $stat->{'Message'} = $msg;
-               $queue->write_job_status($mach, $jid, $stat);
-
-               # Called after writing the status file, so that the front-end watching
-               # our status FIFO can see the new status file.
                update_status($mach, $jid, $s, $queue, $msg);
 
                if ($s eq 'OK') {
@@ -197,6 +188,7 @@ for my $mach (@machines) {
                        }
                }
        }
+} continue {
        update_status($mach, '-', 'DONE', undef);
 }
 $queue->unlock;