diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/MGA/Mirrors/DB.pm | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/MGA/Mirrors/DB.pm b/lib/MGA/Mirrors/DB.pm index a7655b8..80005a3 100644 --- a/lib/MGA/Mirrors/DB.pm +++ b/lib/MGA/Mirrors/DB.pm @@ -218,7 +218,6 @@ sub check_distributions { my $listd = $self->db->prepare(q{ select * from toplevel_urls, distributions - where toplevel_urls.valid = true }); my $addstatus = $self->db->prepare(q{ @@ -257,11 +256,13 @@ sub check_distributions { $upd_url_lastok->execute($res->{key}) if ($ok); $urls_status{$res->{key}} = $ok; } - $urls_status{$res->{key}} or next; - my $furi = URI->new(join('/', $url, $res->{relpath}, $res->{relfile})); - my $exists = $self->_check_url($furi); + my $exists; + if ($urls_status{$res->{key}}) { + my $furi = URI->new(join('/', $url, $res->{relpath}, $res->{relfile})); + $exists = $self->_check_url($furi); + } if ($updstatus->execute($exists ? 1 : 0, $res->{key}, $res->{dkey}) == 0) { - $addstatus->execute($res->{key}, $res->{dkey}, $exists); + $addstatus->execute($res->{key}, $res->{dkey}, $exists ? 1 : 0); } $upd_lastok->execute($res->{key}, $res->{dkey}) if ($exists); $self->db->commit; |