Branch Coverage

blib/lib/Minion/Backend/Storable.pm
Criterion Covered Total %
branch 61 66 92.4


line true false branch
25 0 4 @$ids ? :
4 3 unless @$ids
72 25 406 unless my $job = $guard->_jobs->{$id}
110 25 50 unless @$locks < $limit
111 10 40 unless $duration > 0
116 40 0 if ($$locks[$#$locks] // 0) < $this_expires
126 10 10 unless my $job = $guard->_write->_jobs->{$id}
143 30 112 $id ? :
144 112 30 unless ($worker)
155 31 0 if my $removed = !!$guard->_job($id, ('failed', 'finished', 'inactive'))
174 141 31 unless $job->{'state'} eq 'finished' and $job->{'finished'} <= $after
176 29 2 unless grep(($jobs->{$_}{'state'} ne 'finished'), @{$guard->_children($job->{'id'});})
196 10 55 unless my $job = $guard->_job($id, ('active', 'failed', 'finished', 'inactive'))
197 2 53 unless $job->{'retries'} == $retries
200 10 43 if $options->{'delay'}
216 18 231 if $job->{'state'} eq 'active' and not $seen{$job->{'worker'}}++
218 7 48 if $job->{'state'} eq 'inactive' and &Minion::Backend::Storable::time() < $job->{'delayed'} || @{$job->{'parents'};}
243 20 35 if $i >= $length
269 0 5 unless $Minion::Backend::Storable::b->{'priority'} <=> $Minion::Backend::Storable::a->{'priority'}
277 193 9 unless my(@parents) = @{$candidate->{'parents'} // [];}
280 6 9 if exists $jobs->{$parent} and grep(($jobs->{$parent}{'state'} eq $_), ('active', 'failed', 'inactive'))
285 66 196 unless $job
295 42 156 unless my $job = $guard->_job($id, 'active')
296 2 154 unless $job->{'retries'} == $retries
300 58 96 $fail ? :
303 149 5 unless $fail and $job->{'attempts'} > $retries + 1
311 15 85 unless $id and my $worker = $guard->_workers->{$id}
329 1063 766 if $self->{'write'}
336 6 1823 unless -f $path
346 7 4630 if grep(($_ eq $id), @{$job->{'parents'} // [];})
364 10 284 unless my $job = $self->_jobs->{$id}
365 242 42 grep(($job->{'state'} eq $_), @_) ? :
388 1063 0 if ++$_[0]{'write'}