Stop creating new goroutines for irc.Connect() since it doesnt block anymore

This commit is contained in:
Ken-Håvard Lieng 2015-06-06 01:02:02 +02:00
parent adcf12e1fa
commit ebdb382706
2 changed files with 20 additions and 25 deletions

View File

@ -69,10 +69,8 @@ func reconnect() {
i.Password = server.Password
i.Realname = server.Realname
go func(server storage.Server) {
i.Connect(server.Address)
session.setIRC(i.Host, i)
go handleIRC(i, session)
var joining []string
@ -82,7 +80,6 @@ func reconnect() {
}
}
i.Join(joining...)
}(server)
}
}
}

View File

@ -99,7 +99,6 @@ func handleWS(conn *websocket.Conn) {
session.setIRC(data.Server[:idx], i)
}
go func() {
i.Connect(data.Server)
go handleIRC(i, session)
@ -112,7 +111,6 @@ func handleWS(conn *websocket.Conn) {
Username: data.Username,
Realname: data.Realname,
})
}()
} else {
log.Println(addr, "already connected to", data.Server)
}