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,20 +69,17 @@ func reconnect() {
i.Password = server.Password
i.Realname = server.Realname
go func(server storage.Server) {
i.Connect(server.Address)
session.setIRC(i.Host, i)
i.Connect(server.Address)
session.setIRC(i.Host, i)
go handleIRC(i, session)
go handleIRC(i, session)
var joining []string
for _, channel := range channels {
if channel.Server == server.Address {
joining = append(joining, channel.Name)
}
var joining []string
for _, channel := range channels {
if channel.Server == server.Address {
joining = append(joining, channel.Name)
}
i.Join(joining...)
}(server)
}
i.Join(joining...)
}
}
}