From 9d1063187a4d62312288aa3ce86ac2e267729054 Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Wed, 20 May 2026 23:02:37 +0000 Subject: [PATCH] Try to recognize email websocket going away --- comms/email/websocket.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/comms/email/websocket.go b/comms/email/websocket.go index 657a6797..9c208ffd 100644 --- a/comms/email/websocket.go +++ b/comms/email/websocket.go @@ -80,6 +80,12 @@ func StartWebsocket(ctx context.Context, username, password string) { time.Sleep(10 * time.Second) continue } + if websocket.IsCloseError(err, websocket.CloseGoingAway) { + conn = nil + log.Info().Msg("email websocket server going away") + time.Sleep(60 * time.Second) + continue + } log.Error().Err(err).Msg("Error reading message") time.Sleep(10 * time.Second) continue