about summary refs log tree commit diff
path: root/scripts/download-from-binary-cache.pl.in
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-06-07T14·21+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-06-07T14·25+0200
commit5c06e5297d3e8660abfa238b7244d958237e54e8 (patch)
treec059a0add2018e23fa784c7309b53955e1830d73 /scripts/download-from-binary-cache.pl.in
parent24a356bf71e8c75bc7dbf9b4a619552b4ebe873c (diff)
download-from-binary-cache.pl: Respect $NIX_CONNECT_TIMEOUT
Diffstat (limited to 'scripts/download-from-binary-cache.pl.in')
-rw-r--r--scripts/download-from-binary-cache.pl.in1
1 files changed, 1 insertions, 0 deletions
diff --git a/scripts/download-from-binary-cache.pl.in b/scripts/download-from-binary-cache.pl.in
index 332fe5ba5634..10444dc61bc8 100644
--- a/scripts/download-from-binary-cache.pl.in
+++ b/scripts/download-from-binary-cache.pl.in
@@ -59,6 +59,7 @@ sub addRequest {
     $curl->setopt(CURLOPT_USERAGENT, "Nix/$Nix::Config::version");
     $curl->setopt(CURLOPT_NOBODY, 1) if $head;
     $curl->setopt(CURLOPT_FAILONERROR, 1);
+    $curl->setopt(CURLOPT_TIMEOUT, int($ENV{"NIX_CONNECT_TIMEOUT"} // 0));
 
     if ($activeRequests >= $maxParallelRequests) {
         $scheduled{$curlId} = 1;