From 4d1581c4a05fb1a7dd769c9eb41f24d89df0da9e Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Tue, 24 Sep 2024 12:58:04 +1000 Subject: [PATCH] feat: Update last down to go back 30 days --- server.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/server.py b/server.py index 2566015..7f407c6 100644 --- a/server.py +++ b/server.py @@ -820,7 +820,7 @@ def index(): f"The {node['name']} node's certificate is expiring {format_relative_time(cert_853_expiry)} for DNS over TLS (port 853)" ) - history_days = 7 + history_days = 30 if "history" in request.args: try: history_days = int(request.args["history"]) @@ -833,10 +833,11 @@ def index(): for node in history_summary["nodes"]: for key in ["plain_dns", "doh", "dot"]: if node[key]["last_down"] == "Never": - continue - node[key]["last_down"] = format_last_check( - datetime.strptime(node[key]["last_down"], "%Y-%m-%d %H:%M:%S") - ) + node[key]["last_down"] = "over 30 days ago" + else: + node[key]["last_down"] = format_last_check( + datetime.strptime(node[key]["last_down"], "%Y-%m-%d %H:%M:%S") + ) for key in ["plain_dns", "doh", "dot"]: if history_summary["overall"][key]["last_down"] == "Never":