Stop creating new goroutines for irc.Connect() since it doesnt block anymore
This commit is contained in:
parent
adcf12e1fa
commit
ebdb382706
@ -69,10 +69,8 @@ func reconnect() {
|
|||||||
i.Password = server.Password
|
i.Password = server.Password
|
||||||
i.Realname = server.Realname
|
i.Realname = server.Realname
|
||||||
|
|
||||||
go func(server storage.Server) {
|
|
||||||
i.Connect(server.Address)
|
i.Connect(server.Address)
|
||||||
session.setIRC(i.Host, i)
|
session.setIRC(i.Host, i)
|
||||||
|
|
||||||
go handleIRC(i, session)
|
go handleIRC(i, session)
|
||||||
|
|
||||||
var joining []string
|
var joining []string
|
||||||
@ -82,7 +80,6 @@ func reconnect() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
i.Join(joining...)
|
i.Join(joining...)
|
||||||
}(server)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -99,7 +99,6 @@ func handleWS(conn *websocket.Conn) {
|
|||||||
session.setIRC(data.Server[:idx], i)
|
session.setIRC(data.Server[:idx], i)
|
||||||
}
|
}
|
||||||
|
|
||||||
go func() {
|
|
||||||
i.Connect(data.Server)
|
i.Connect(data.Server)
|
||||||
go handleIRC(i, session)
|
go handleIRC(i, session)
|
||||||
|
|
||||||
@ -112,7 +111,6 @@ func handleWS(conn *websocket.Conn) {
|
|||||||
Username: data.Username,
|
Username: data.Username,
|
||||||
Realname: data.Realname,
|
Realname: data.Realname,
|
||||||
})
|
})
|
||||||
}()
|
|
||||||
} else {
|
} else {
|
||||||
log.Println(addr, "already connected to", data.Server)
|
log.Println(addr, "already connected to", data.Server)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user