Commit b98517d7 authored by Christian Fibich's avatar Christian Fibich Committed by Stefan Tauner
Browse files

Check if queue has been ended before appending

parent 45aeb020
......@@ -63,7 +63,7 @@ sub log_message {
my $self = shift;
my %p = @_;
$self->{'queue'}->enqueue(\%p);
$self->{'queue'}->enqueue(\%p) if (!$self->{'queue'}->{'ENDED'});
}
1;
......
......@@ -101,7 +101,7 @@ sub download_worker {
my $cont = 1;
$SIG{'STOP'} = sub { $cont = 0; };
$queue_to_gui->enqueue({'state' => "starting"});
$queue_to_gui->enqueue({'state' => "starting"}) if (!$queue_to_gui->{'ENDED'});
# We need to re-append the log queue to the logger here because
# the GUI does it after this thread is created and hence the
......@@ -126,7 +126,7 @@ sub download_worker {
my $worker_msg = shift;
# reply to GUI (intermediate)
$queue_to_gui->enqueue({'state' => "ongoing", 'rmsg' => $worker_msg});
$queue_to_gui->enqueue({'state' => "ongoing", 'rmsg' => $worker_msg}) if (!$queue_to_gui->{'ENDED'});
return $cont;
},
);
......@@ -139,7 +139,7 @@ sub download_worker {
my $worker_msg = shift;
# reply to GUI (intermediate)
$queue_to_gui->enqueue({'state' => "ongoing", 'rmsg' => $worker_msg});
$queue_to_gui->enqueue({'state' => "ongoing", 'rmsg' => $worker_msg}) if (!$queue_to_gui->{'ENDED'});
return $cont;
},
);
......@@ -154,7 +154,7 @@ sub download_worker {
}
# reply to GUI (last message of current work package)
$queue_to_gui->enqueue({'state' => "finished", 'rmsg' => $worker_msg, 'testref' => $testref});
$queue_to_gui->enqueue({'state' => "finished", 'rmsg' => $worker_msg, 'testref' => $testref}) if (!$queue_to_gui->{'ENDED'});
}
};
if ($@ ne "") {
......@@ -162,7 +162,7 @@ sub download_worker {
# Return only first line of what eval returns to the GUI.
# Usually this is something like:
# "ERROR: can't load appenderclass 'Log::Dispatch::QueueAppender'"
$queue_to_gui->enqueue({'state' => "dying", 'rmsg' => (split /\n/, $@)[0]});
$queue_to_gui->enqueue({'state' => "dying", 'rmsg' => (split /\n/, $@)[0]}) if (!$queue_to_gui->{'ENDED'});
}
}
......
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