From 7c60fa0c986c45717a865e179b5d692a7ab08e32 Mon Sep 17 00:00:00 2001 From: onefang Date: Fri, 3 Jan 2020 23:24:44 +1000 Subject: A few less steps in some of the time calcs. --- apt-panopticommon.lua | 3 +-- apt-panopticon.lua | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/apt-panopticommon.lua b/apt-panopticommon.lua index ffc3af4..dddcc9c 100644 --- a/apt-panopticommon.lua +++ b/apt-panopticommon.lua @@ -698,8 +698,7 @@ end APT.now = 0 local status -APT.now = APT.exe('TZ="GMT" ls -l --time-style="+%s" results/stamp | cut -d " " -f 6-6'):Do().result -APT.now = tonumber(APT.now) +APT.now = tonumber(APT.exe('TZ="GMT" ls -l --time-style="+%s" results/stamp | cut -d " " -f 6-6'):Do().result) local start = 'now-1month' local step = '10min' local hb = '150min' diff --git a/apt-panopticon.lua b/apt-panopticon.lua index e9b1015..5797f91 100755 --- a/apt-panopticon.lua +++ b/apt-panopticon.lua @@ -853,10 +853,8 @@ local parseRelease = function(host) coroutine.yield() D('*>* Resumed coroutine while waiting on - not APT.checkFile(results_old/' .. fRp .. ')') end - local pkt = APT.exe([[TZ="GMT" date -d "$(grep '^Date:' results/]] .. fRp .. [[ | cut -d ' ' -f 2-)" '+%s']]):Do().result - pkt = tonumber(pkt:sub(2, -2)) - local new = APT.exe([[TZ="GMT" date -d "$(grep '^Date:' ]] .. fR .. [[.SORTED | cut -d ' ' -f 2-)" '+%s']]):Do().result - new = tonumber(new:sub(2, -2)) + local pkt = tonumber(APT.exe([[TZ="GMT" date -d "$(grep '^Date:' results/]] .. fRp .. [[ | cut -d ' ' -f 2-)" '+%s']]):Do().result:sub(2, -2)) + local new = tonumber(APT.exe([[TZ="GMT" date -d "$(grep '^Date:' ]] .. fR .. [[.SORTED | cut -d ' ' -f 2-)" '+%s']]):Do().result:sub(2, -2)) local upd = pkt + APT.mirrors[host].Updated local updd = pkt + (APT.mirrors[host].Updated * 1.5) -- Give the mirror time to actually do the update. if pkt > new then -- cgit v1.1