diff --git a/hbd/server/udp.py b/hbd/server/udp.py index 733db72..b5ad5ad 100644 --- a/hbd/server/udp.py +++ b/hbd/server/udp.py @@ -440,14 +440,18 @@ def handle_datagram(msg: dict, addr, transport, ctx: dict): if not newh: if d == 0 or lasts == "unknown": m = "%s is up" % (conn.afam) + elif d < 4: + # Transient blip (likely client restart) — skip log and notification + m = None else: m = "%s back after being %s for %s" % (conn.afam, lasts, dur(d)) - eventlog(uname, "RECOVER", m) - if host.watched: - asyncio.create_task(notify_mod.send_notification( - uname, - notify_mod.Notification(title=f"[RECOVER] {uname}", body=m, level="RECOVER"), - )) + if m: + eventlog(uname, "RECOVER", m) + if host.watched: + asyncio.create_task(notify_mod.send_notification( + uname, + notify_mod.Notification(title=f"[RECOVER] {uname}", body=m, level="RECOVER"), + )) if boot or newh: host.upcount = host.doesack