Commit ae4ca901 authored by Leo Gordon's avatar Leo Gordon
Browse files

bugfix: last_check_in should only be updated by register_worker_death if the...

bugfix:  last_check_in should only be updated by register_worker_death if the Worker is burying itself
parent de73fc76
......@@ -296,14 +296,15 @@ sub specialize_new_worker {
sub register_worker_death {
my ($self, $worker) = @_;
my ($self, $worker, $self_burial) = @_;
return unless($worker);
my $cod = $worker->cause_of_death() || 'UNKNOWN'; # make sure we do not attempt to insert a void
# FIXME: make it possible to set the 'died' timestamp if we have detected it from logs:
my $sql = qq{UPDATE worker SET died=CURRENT_TIMESTAMP
,last_check_in=CURRENT_TIMESTAMP
} . ( $self_burial ? ',last_check_in=CURRENT_TIMESTAMP ' : '') . qq{
,status='DEAD'
,work_done='}. $worker->work_done . qq{'
,cause_of_death='$cod'
......
......@@ -582,7 +582,7 @@ sub run {
}
}
$self->adaptor->register_worker_death($self);
$self->adaptor->register_worker_death($self, 1);
if($self->debug) {
$self->worker_say( 'AnalysisStats :'.$self->analysis->stats->toString ) if($self->analysis_id());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment