don't hammer server if conn terminated during reconnection

This commit is contained in:
Jeffrey Paul 2024-11-29 07:49:50 -08:00 committed by GitHub
parent 73e444401d
commit 8399256730
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

3
irc.go
View File

@ -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)