From 515c9b638996838b6eb89482321418ded06aaa52 Mon Sep 17 00:00:00 2001 From: onefang Date: Wed, 4 Dec 2019 08:14:59 +1000 Subject: Report the timeout differently, the other was a hack that caused problems. --- apt-panopticon-report-email-web.lua | 8 ++++---- apt-panopticon.lua | 12 ++---------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/apt-panopticon-report-email-web.lua b/apt-panopticon-report-email-web.lua index 9e9d818..3f2f257 100755 --- a/apt-panopticon-report-email-web.lua +++ b/apt-panopticon-report-email-web.lua @@ -169,7 +169,7 @@ local status = function(host, results, typ) local e = 0 local w = 0 local s = nil ~= mirrors[host].Protocols[typ] - local to = false + local to = results.timeout if ('http' ~= typ) and ('https' ~= typ) and ('ftp' ~= typ) and ('rsync' ~= typ) then s = true end if nil ~= results[typ] then e = results[typ].errors @@ -188,8 +188,8 @@ local status = function(host, results, typ) for i, u in pairs(v) do if "table" == type(u) then if typ == i then - if 0 <= u.errors then e = e + u.errors else to = true end - if 0 <= u.warnings then w = w + u.warnings else to = true end + if 0 <= u.errors then e = e + u.errors end + if 0 <= u.warnings then w = w + u.warnings end end end end @@ -262,7 +262,7 @@ local collate = function(host, ip, results) end end end - else + elseif "timeout" ~= k then local a = results[k] if nil == a then a = 0 end results[k] = a + v diff --git a/apt-panopticon.lua b/apt-panopticon.lua index 5aa1e8d..f0a3128 100755 --- a/apt-panopticon.lua +++ b/apt-panopticon.lua @@ -1055,17 +1055,9 @@ if 0 < #arg then end end + results["timeout"] = false else - for k, v in pairs{"ftp", "http", "https", "rsync"} do - if testing(v) then - local tests = results[v] - if testing("Integrity") then tests.Integrity = {errors = -1; warnings = -1} end - if testing("Protocol") then tests.Protocol = {errors = -1; warnings = -1} end - if testing("Updated") then tests.Updated = {errors = -1; warnings = -1} end - if testing("URLSanity") then tests.URLSanity = {errors = -1; warnings = -1} end - results[v] = tests - end - end + results["timeout"] = true end end -- cgit v1.1