download-from-binary-cache.pl: Respect $NIX_CONNECT_TIMEOUT

This commit is contained in:
Eelco Dolstra 2013-06-07 16:21:48 +02:00
parent 24a356bf71
commit 5c06e5297d

View file

@ -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;