chiark / gitweb /
git-cache-proxy: New --serve-timeout option.
[chiark-utils.git] / scripts / git-cache-proxy
index 647f6b6..ffdf6ea 100755 (executable)
@@ -67,6 +67,7 @@ our $housekeepingeverydays = 1;
 our $treeexpiredays = 21;
 our $fetchtimeout = 1800;
 our $maxfetchtimeout = 3600;
 our $treeexpiredays = 21;
 our $fetchtimeout = 1800;
 our $maxfetchtimeout = 3600;
+our $servetimeout = 1000;
 our $cachedir = '/var/cache/git-cache-proxy';
 our $housekeepingonly = 0;
 
 our $cachedir = '/var/cache/git-cache-proxy';
 our $housekeepingonly = 0;
 
@@ -172,6 +173,7 @@ for (;;) {
            $cachedir = $1;
        } elsif (s/^--( max-fetch-timeout
                       | fetch-timeout
            $cachedir = $1;
        } elsif (s/^--( max-fetch-timeout
                       | fetch-timeout
+                      | serve-timeout
                       | tree-expire-days
                       | housekeeping-interval-days
                       )=(\d+)$//x) {
                       | tree-expire-days
                       | housekeeping-interval-days
                       )=(\d+)$//x) {
@@ -477,7 +479,7 @@ sub runcommand () {
 
     chdir $gitd or fail "chdir $gitd: $!";
 
 
     chdir $gitd or fail "chdir $gitd: $!";
 
-    exec qw(git-upload-pack --strict --timeout=1000 .)
+    exec qw(git-upload-pack --strict), "--timeout=$servetimeout", qw(.)
        or fail "exec git-upload-pack: $!";
 }
 
        or fail "exec git-upload-pack: $!";
 }