diff options
author | Olivier Thauvin <nanardon@mageia.org> | 2010-10-21 06:13:21 +0000 |
---|---|---|
committer | Olivier Thauvin <nanardon@mageia.org> | 2010-10-21 06:13:21 +0000 |
commit | 3f2d223640af766ef2fdeb37a7acf36af602aa61 (patch) | |
tree | 056ff84c72d16ad4233c733b864eeec8e742259c /lib | |
parent | 6e1216e0f4a1728e53a50cdeb0085ba8552a4d50 (diff) | |
download | mgamirrors-3f2d223640af766ef2fdeb37a7acf36af602aa61.tar mgamirrors-3f2d223640af766ef2fdeb37a7acf36af602aa61.tar.gz mgamirrors-3f2d223640af766ef2fdeb37a7acf36af602aa61.tar.bz2 mgamirrors-3f2d223640af766ef2fdeb37a7acf36af602aa61.tar.xz mgamirrors-3f2d223640af766ef2fdeb37a7acf36af602aa61.zip |
- fix mirror checking
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; |