Skip to content
This repository was archived by the owner on Nov 26, 2018. It is now read-only.

Commit 0bc1136

Browse files
committed
refs #15. give a grace period of 3 missed reply to Ping.
1 parent b9f1f88 commit 0bc1136

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

network/irc/irc.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ func (bot *ircBot) monitor() {
102102
for bot.IsRunning() {
103103
if pongCounter > maxPongWithoutMessage {
104104
glog.Infoln("More than maxPongWithoutMessage pong without message for", bot)
105+
glog.Infoln("IRC monitoring KO", bot)
105106
bot.reconnect()
106107
}
107108
select {
@@ -121,8 +122,9 @@ func (bot *ircBot) monitor() {
121122
}
122123
case <-time.After(time.Second * 10):
123124
glog.Infoln("No pong from ircBot server", bot)
124-
glog.Infoln("IRC monitoring KO.")
125-
bot.reconnect()
125+
// Do not kill the server on the first missed PONG
126+
// 3 chances 15/5
127+
pongCounter += 5
126128
}
127129
}
128130
}

0 commit comments

Comments
 (0)