]> git.donarmstrong.com Git - bin.git/commitdiff
sleep for longer in get sgf
authorDon Armstrong <don@donarmstrong.com>
Sat, 15 Mar 2008 01:29:58 +0000 (01:29 +0000)
committerDon Armstrong <don@donarmstrong.com>
Sat, 15 Mar 2008 01:29:58 +0000 (01:29 +0000)
get_sgf

diff --git a/get_sgf b/get_sgf
index b6d41534a34c29742eb5d7d11a083af8d801cabb..0ce9a6ede2c9b06c61f5287bd35636decc7d2021 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,9 +139,10 @@ for my $url (@ARGV) {
                    $m->save_content('temp.ps');
                    last VALID_LOOP;
               }
-              print STDERR "Failure to download content, waiting 180 seconds\n";
+              $sleep = 240+int(rand*120);
+              print STDERR "Failure to download content, waiting $sleep seconds\n";
               $m = $state;
-         } while (sleep 180);
+         } while (sleep $sleep);
      }
      system('gzip','temp.ps');
      system("$ENV{HOME}/bin/sgf_rename",'temp.sgf');