Skip to content

Commit

Permalink
Add debug message if we could not get a guard
Browse files Browse the repository at this point in the history
  • Loading branch information
perlpunk committed Sep 26, 2024
1 parent d299c40 commit 8b49b5a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/OpenQA/Task/Git/Clone.pm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use Mojo::Base 'Mojolicious::Plugin', -signatures;
use Mojo::Util 'trim';

use Mojo::File;
use OpenQA::Log qw(log_debug);
use Time::Seconds 'ONE_HOUR';

sub register ($self, $app, @) {
Expand All @@ -30,9 +31,14 @@ sub _git_clone_all ($job, $clones) {
# Prevent multiple git_clone tasks for the same path to run in parallel
my @guards;
for my $path (sort keys %$clones) {
my $guard_name = "git_clone_${path}_task";
$path = Mojo::File->new($path)->realpath if -e $path; # resolve symlinks
my $guard = $app->minion->guard("git_clone_${path}_task", 2 * ONE_HOUR);
return $job->retry($retry_delay) unless $guard;
my $guard = $app->minion->guard($guard_name, 2 * ONE_HOUR);
unless ($guard) {
log_debug("Could not get guard for '$guard_name', retrying in $retry_delay->{delay}s")

Check warning on line 38 in lib/OpenQA/Task/Git/Clone.pm

View check run for this annotation

Codecov / codecov/patch

lib/OpenQA/Task/Git/Clone.pm#L38

Added line #L38 was not covered by tests
; # uncoverable statement
return $job->retry($retry_delay); # uncoverable statement
}
push @guards, $guard;
}

Expand Down

0 comments on commit 8b49b5a

Please sign in to comment.