jobd.pl: do not attempt to update if .clone_failed exists
authorKyle J. McKay <mackyle@gmail.com>
Sun, 11 Aug 2013 09:15:26 +0000 (11 02:15 -0700)
committerKyle J. McKay <mackyle@gmail.com>
Sun, 11 Aug 2013 09:15:26 +0000 (11 02:15 -0700)
Previously if .clone_failed existed but .clone_in_progress did not
then an update would still be attempted.

Instead do not attempt any update when .clone_failed exists.

jobd/jobd.pl

index acab3c3..3028b4a 100755 (executable)
@@ -40,16 +40,16 @@ sub update_project {
                job_skip($job);
                return setup_gc($job);
        }
-       if (-e get_project_path($p).".clone_in_progress") {
-               if (-e get_project_path($p).".clone_failed") {
-                       job_skip($job, "initial mirroring failed");
-                       # Still need to gc non top-level clones even if they've failed
-                       # otherwise the objects copied into them from the parent will
-                       # just accumulate without bound
-                       setup_gc($job) if $p =~ m,/,;
-               } else {
-                       job_skip($job, "initial mirroring not complete yet");
-               }
+       if (-e get_project_path($p).".clone_in_progress" && ! -e get_project_path($p).".clone_failed") {
+               job_skip($job, "initial mirroring not complete yet");
+               return;
+       }
+       if (-e get_project_path($p).".clone_failed") {
+               job_skip($job, "initial mirroring failed");
+               # Still need to gc non top-level clones even if they've failed
+               # otherwise the objects copied into them from the parent will
+               # just accumulate without bound
+               setup_gc($job) if $p =~ m,/,;
                return;
        }
        if (my $ts = is_operation_uptodate($p, 'lastrefresh', rand_adjust($Girocco::Config::min_mirror_interval))) {