From 83992567303d1b3a69595d7fcb337db5d61b3a49 Mon Sep 17 00:00:00 2001 From: Jeffrey Paul <408977+sneak@users.noreply.github.com> Date: Fri, 29 Nov 2024 07:49:50 -0800 Subject: [PATCH] don't hammer server if conn terminated during reconnection --- irc.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/irc.go b/irc.go index a02b2b7..1a2663c 100644 --- a/irc.go +++ b/irc.go @@ -242,7 +242,8 @@ func (irc *Connection) Loop() { } irc.Wait() for !irc.isQuitting() { - irc.Log.Printf("Error, disconnected: %s\n", err) + irc.Log.Printf("Error, disconnected: %s, 15s backoff\n", err) + time.Sleep(15 * time.Second) if err = irc.Reconnect(); err != nil { irc.Log.Printf("Error while reconnecting: %s\n", err) time.Sleep(60 * time.Second)