Log startup errors and only try to start users who have a token

This commit is contained in:
Tulir Asokan
2022-05-23 23:17:28 +03:00
parent 888731cec2
commit 17288f3d04
2 changed files with 8 additions and 3 deletions

View File

@@ -182,8 +182,13 @@ func (br *DiscordBridge) getAllUsers() []*User {
func (br *DiscordBridge) startUsers() {
br.Log.Debugln("Starting users")
for _, user := range br.getAllUsers() {
go user.Connect()
for _, u := range br.getAllUsers() {
go func(user *User) {
err := user.Connect()
if err != nil {
user.log.Errorfln("Error connecting: %v", err)
}
}(u)
}
br.Log.Debugln("Starting custom puppets")