From 48b5e0723d6a98b441e28fbf30b70d5238ef6fad Mon Sep 17 00:00:00 2001 From: Daniel Lenski Date: Thu, 13 Jun 2024 11:44:54 -0700 Subject: [PATCH] Handling heartbeats is unnecessary with `skip_heartbeats=True` default The `echo.py` example code can be simplified as a result. --- examples/echo.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/echo.py b/examples/echo.py index 634a59d..25b9a46 100644 --- a/examples/echo.py +++ b/examples/echo.py @@ -6,8 +6,9 @@ def print_callback(message, context): logging.debug("Message -> {}".format(message)) - if message['message_type'] == "heartbeat": - return + # As long as listen_for_events() is called with skip_heartbeats=True, + # (the default), message['message_type'] == "heartbeat" will not be + # received here. if message['message_type'] == "certificate_update": all_domains = message['data']['leaf_cert']['all_domains']