From 9bcdeb5ce39cabe96bb2ebf386c9622a82de7e32 Mon Sep 17 00:00:00 2001 From: onefang Date: Fri, 3 Jan 2020 01:49:05 +1000 Subject: May need to wait on the file to avoid missing speeds after all. I really should get this stuff sorted generically. --- apt-panopticon.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/apt-panopticon.lua b/apt-panopticon.lua index ac18402..2ffda50 100755 --- a/apt-panopticon.lua +++ b/apt-panopticon.lua @@ -941,6 +941,14 @@ os.execute('sleep 1') -- Wait for things to start up before checking for them. local f = 'results/curl-' .. list.out .. "-" .. host .. ".log.txt" + local f = 'results/curl-' .. list.out .. "-" .. host .. ".log.txt" + -- Should not be needed, but maybe this is why sometimes I don't see the speeds, though the file is there aand valid when I look later. + while not APT.checkFile(f) do + D('*<* About to yield coroutine while waiting on - not APT.checkFile(' .. f .. ')') + coroutine.yield() + D('*>* Resumed coroutine while waiting on - not APT.checkFile(' .. f .. ')') + end + --[[ TODO - should try to figure out which server the file actually got downloaded from, and attribute the speed and errors to that server. Which means parsing the curl logs, not just a simple match(). Watch out for misplaced ^M, they don't all come at the end of the line. -- cgit v1.1