From 0ab93caec4a8ac78850346ee88c170888b6ac47e Mon Sep 17 00:00:00 2001 From: Krzysztof Findeisen Date: Mon, 15 Jul 2024 11:27:18 -0700 Subject: [PATCH 1/2] Add time zone to old message warning. --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 5ad9073..ca46f35 100644 --- a/src/main.py +++ b/src/main.py @@ -281,7 +281,7 @@ async def main() -> None: published = next_visit_message_initial["message"]["private_efdStamp"] age = time.time() - published if age > expire: - logging.warning("Message published at %s is %s old, ignoring.", + logging.warning("Message published on %s UTC is %s old, ignoring.", time.ctime(published), datetime.timedelta(seconds=age) ) From 553c20d4e9a5c40b125f030980b1f4eca3bd7fb4 Mon Sep 17 00:00:00 2001 From: Krzysztof Findeisen Date: Mon, 15 Jul 2024 11:30:31 -0700 Subject: [PATCH 2/2] Strip microseconds from old messages' age. --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index ca46f35..a6ef077 100644 --- a/src/main.py +++ b/src/main.py @@ -279,7 +279,7 @@ async def main() -> None: # efdStamp is visit publication, in seconds since 1970-01-01 UTC if next_visit_message_initial["message"]["private_efdStamp"]: published = next_visit_message_initial["message"]["private_efdStamp"] - age = time.time() - published + age = round(time.time() - published) # Microsecond precision is distracting if age > expire: logging.warning("Message published on %s UTC is %s old, ignoring.", time.ctime(published),