From 0ecba6222db7adf0d2bf235dd8fbc9a8951aa555 Mon Sep 17 00:00:00 2001 From: j Date: Fri, 9 Aug 2024 15:41:19 +0200 Subject: [PATCH] don't fail if zeroconf interface was shut down --- oml/localnodes.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/oml/localnodes.py b/oml/localnodes.py index 2b78cb5..dcd2751 100644 --- a/oml/localnodes.py +++ b/oml/localnodes.py @@ -139,7 +139,10 @@ class LocalNodes(dict): await asyncio.gather(*tasks) def on_service_state_change(self, zeroconf, service_type, name, state_change): - info = zeroconf.get_service_info(service_type, name) + try: + info = zeroconf.get_service_info(service_type, name) + except zeroconf._exceptions.NotRunningException: + return if info and b'id' in info.properties: id = info.properties[b'id'].decode() if id == settings.USER_ID: