Fix region handling of broken mirrors
[grml-mirrors.git] / bin / generate_mirror_map
index 6d37e1b..d41107c 100755 (executable)
@@ -17,9 +17,9 @@ foreach my $url ( keys %{$state} ) {
        $mirror = $state -> { $url } ; # a Mirmon::Mirror object
        my ($time, $history) = split('-', $mirror->{state_history});
        my $last_state = substr($history,-1,1);
+       next if $last_state eq 'f';
        my $region = $mirror->region;
        $regions_hash->{$region} = 1;
-       next if $last_state eq 'f';
        $mirrors->{ $region } ||= [];
        $url =~ s/^http:\/\///;
        push @{$mirrors->{ $region }}, $url;