Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid calling is_running unnecessarily in kill #6110

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Avoid calling is_running unnecessarily in kill
The `stop` function does the same check internally so it isn't required.

Related ticket: https://progress.opensuse.org/issues/170209
Martchus committed Jan 13, 2025
commit 03a92190703390cf482742817ac42b791fae265a
11 changes: 3 additions & 8 deletions lib/OpenQA/Worker/Job.pm
Original file line number Diff line number Diff line change
@@ -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 {