From 2b71b2ed47a778ead5d14e5e395ba278b9a605ea Mon Sep 17 00:00:00 2001 From: onefang Date: Thu, 12 Dec 2019 17:21:39 +1000 Subject: Attempt to clean up after mirrors timeout. It still wont clean up the STATUS_* files, so only partially fixed. --- apt-panopticon.lua | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/apt-panopticon.lua b/apt-panopticon.lua index 5dc2570..33d1ef3 100755 --- a/apt-panopticon.lua +++ b/apt-panopticon.lua @@ -784,11 +784,6 @@ if 0 < #arg then end end - if APT.origin and APT.options.referenceSite.value ~= pu.host then - if not APT.keep then os.execute("rm -fr results/" .. pu.host .. " 2>/dev/null") end - os.execute('rm STATUS_' .. pu.host .. '* 2>/dev/null') - end - local min, max, spd = 999999999999, 0 for i, mt in pairs({'Release', 'Packages', 'package'}) do if APT.checkFile("results/curl-" .. mt .. "-" .. pu.host .. ".log") then @@ -820,6 +815,16 @@ if 0 < #arg then rfile:write(APT.dumpTable(APT.results, "", "results") .. "\nreturn results\n") rfile:close() end + + if APT.origin and APT.options.referenceSite.value ~= pu.host then + while 0 < APT.checkExes(downloadLock .. "Release-" .. pu.host .. ".log") do os.execute("sleep 10") end + while 0 < APT.checkExes(downloadLock .. "package-" .. pu.host .. ".log") do os.execute("sleep 10") end + while 0 < APT.checkExes(downloadLock .. "Packages-" .. pu.host .. ".log") do os.execute("sleep 10") end + os.execute("sleep 5") + if not APT.keep then os.execute("rm -fr results/" .. pu.host .. " 2>/dev/null") end + os.execute('rm STATUS_' .. pu.host .. '_* 2>/dev/null') + end + APT.logPost() APT.logFile:close() else -- cgit v1.1