]> git.donarmstrong.com Git - bin.git/blobdiff - get_sgf
* add total element to the invoice template
[bin.git] / get_sgf
diff --git a/get_sgf b/get_sgf
index 973550d98fcc7312fd68a057e0b1204625c9fd38..117912aa68d518f05ba2e90eebb8062ec9480401 100755 (executable)
--- a/get_sgf
+++ b/get_sgf
@@ -130,6 +130,7 @@ for my $url (@ARGV) {
      $m->submit();
      my $content;
      my $state;
+     my $sleep;
  VALID_LOOP: {
          do {
               $state = $m->clone;
@@ -138,8 +139,10 @@ for my $url (@ARGV) {
                    $m->save_content('temp.ps');
                    last VALID_LOOP;
               }
+              $sleep = 240+int(rand()*120);
+              print STDERR "Failure to download content, waiting $sleep seconds\n";
               $m = $state;
-         } while (sleep 30);
+         } while (sleep $sleep);
      }
      system('gzip','temp.ps');
      system("$ENV{HOME}/bin/sgf_rename",'temp.sgf');