From 196322a8b061cd671a1552e4115d7b46ac6cf3f6 Mon Sep 17 00:00:00 2001 From: onefang Date: Tue, 3 Dec 2019 06:25:01 +1000 Subject: Add max time for each download. --- apt-panopticon.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'apt-panopticon.lua') diff --git a/apt-panopticon.lua b/apt-panopticon.lua index 21e7599..fd757ec 100755 --- a/apt-panopticon.lua +++ b/apt-panopticon.lua @@ -48,6 +48,12 @@ options = "Updated", }, }, + maxtime = + { + typ = "number", + help = "", + value = 300, + }, timeout = { typ = "number", @@ -679,6 +685,7 @@ local postDownload = function(host, r, k) if options.referenceSite.value == host then if "Packages." == file:sub(1, 9) then -- TODO - compare the SHA256 sums in pkgmaster's Release for both the packed and unpacked versions. +-- Also note that this might get only a partial download due to maxtime. local Pp, e = io.open('results/' .. host .. '/merged/dists/'.. r .. dir .. 'Packages.parsed', "w+") if nil == Pp then W('opening results/' .. host .. '/merged/dists/'.. r .. dir .. 'Packages.parsed' .. ' file - ' .. e) else local pp = {} @@ -734,7 +741,7 @@ local postDownload = function(host, r, k) end local downloadLock = "flock -n results/curl-" -local download = "curl --connect-timeout " .. options.timeout.value .. " --create-dirs -f -L -z 'results/stamp.old' -v -R " +local download = "curl --connect-timeout " .. options.timeout.value .. " --create-dirs -f -L --max-time " .. options.maxtime.value .. " -z 'results/stamp.old' -v -R " local downloads = function(host, URL, release, list) if nil == URL then URL = "" end local lock = "%s-" .. host .. ".lock" -- cgit v1.1