From 3f2d223640af766ef2fdeb37a7acf36af602aa61 Mon Sep 17 00:00:00 2001 From: Olivier Thauvin Date: Thu, 21 Oct 2010 06:13:21 +0000 Subject: - fix mirror checking --- lib/MGA/Mirrors/DB.pm | 11 ++++++----- 1 file 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; -- cgit v1.2.1