add app shutdown to make sure the goroutines finish and all process are closed (#8629)

* run the send email verification as goroutine as well

* add app shutdown to make sure all go routines finish
Этот коммит содержится в:
Carlos Tadeu Panato Junior
2018-04-17 17:06:55 +02:00
коммит произвёл Joram Wilander
родитель 5511106d93
Коммит 51a6e95f58
12 изменённых файлов: 47 добавлений и 4 удалений

Просмотреть файл

@@ -1043,9 +1043,11 @@ func (a *App) UpdateUser(user *model.User, sendNotifications bool) (*model.User,
})
if a.Config().EmailSettings.RequireEmailVerification {
if err := a.SendEmailVerification(rusers[0]); err != nil {
l4g.Error(err.Error())
}
a.Go(func() {
if err := a.SendEmailVerification(rusers[0]); err != nil {
l4g.Error(err.Error())
}
})
}
}