add reconnect irc
This commit is contained in:
parent
c2b96c69d1
commit
06ac36b91d
@ -23,6 +23,9 @@ func InitIRC() {
|
|||||||
conn, err := tls.Dial("tcp", conf.Twitch.ChatHost, tlsConf)
|
conn, err := tls.Dial("tcp", conf.Twitch.ChatHost, tlsConf)
|
||||||
// conn, err := net.Dial("tcp", conf.Twitch.ChatHost)
|
// conn, err := net.Dial("tcp", conf.Twitch.ChatHost)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
fmt.Println("create irc connect fail ", err)
|
||||||
|
time.Sleep(time.Second * 3)
|
||||||
|
go InitIRC()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
defer conn.Close()
|
defer conn.Close()
|
||||||
@ -49,6 +52,7 @@ func InitIRC() {
|
|||||||
channels = channels[:0]
|
channels = channels[:0]
|
||||||
queue.Clear()
|
queue.Clear()
|
||||||
go InitIRC()
|
go InitIRC()
|
||||||
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user