Skip to content

Commit

Permalink
Merge pull request #6110 from Martchus/improve-kill
Browse files Browse the repository at this point in the history
Avoid calling `is_running` unnecessarily in `kill`
  • Loading branch information
mergify[bot] authored Jan 14, 2025
2 parents 0771fde + 03a9219 commit 1b1680b
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions lib/OpenQA/Worker/Job.pm
Original file line number Diff line number Diff line change
Expand Up @@ -315,14 +315,9 @@ sub _handle_engine_startup ($self, $engine, $max_job_time) {
$self->_set_status(running => {});
}

sub kill {
my ($self) = @_;

my $engine = $self->engine;
return unless $engine;

my $child = $engine->{child};
$child->stop if $child && $child->is_running;
sub kill ($self) {
return undef unless my $engine = $self->engine;
if (my $child = $engine->{child}) { $child->stop }
}

sub skip {
Expand Down

0 comments on commit 1b1680b

Please sign in to comment.