Skip to content

Commit

Permalink
Avoid calling is_running unnecessarily in kill
Browse files Browse the repository at this point in the history
The `stop` function does the same check internally so it isn't required.

Related ticket: https://progress.opensuse.org/issues/170209
  • Loading branch information
Martchus committed Jan 13, 2025
1 parent 83f2e29 commit 03a9219
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 03a9219

Please sign in to comment.