diff options
author | Christopher Speller <crspeller@gmail.com> | 2017-01-27 09:37:33 -0500 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2017-01-27 09:37:33 -0500 |
commit | 7b9586a740194a5add773483bd309cff84256b57 (patch) | |
tree | d203b1f769dfd59bf5a44547d637eea75bc89ff2 /app/notification.go | |
parent | 8d2e8525a445a80085282142375b0cc68916d552 (diff) | |
download | chat-7b9586a740194a5add773483bd309cff84256b57.tar.gz chat-7b9586a740194a5add773483bd309cff84256b57.tar.bz2 chat-7b9586a740194a5add773483bd309cff84256b57.zip |
Notifications fix from 3.6 branch
Diffstat (limited to 'app/notification.go')
-rw-r--r-- | app/notification.go | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/app/notification.go b/app/notification.go index ec78c416b..c65635f60 100644 --- a/app/notification.go +++ b/app/notification.go @@ -400,9 +400,11 @@ func sendNotificationEmail(post *model.Post, user *model.User, channel *model.Ch "Hour": fmt.Sprintf("%02d", tm.Hour()), "Minute": fmt.Sprintf("%02d", tm.Minute()), "TimeZone": zone, "Month": month, "Day": day})) - if err := utils.SendMail(user.Email, html.UnescapeString(subject), bodyPage.Render()); err != nil { - return err - } + go func() { + if err := utils.SendMail(user.Email, html.UnescapeString(subject), bodyPage.Render()); err != nil { + l4g.Error(utils.T("api.post.send_notifications_and_forget.send.error"), user.Email, err) + } + }() if einterfaces.GetMetricsInterface() != nil { einterfaces.GetMetricsInterface().IncrementPostSentEmail() @@ -497,9 +499,7 @@ func sendPushNotification(post *model.Post, user *model.User, channel *model.Cha for _, session := range sessions { tmpMessage := *model.PushNotificationFromJson(strings.NewReader(msg.ToJson())) tmpMessage.SetDeviceIdAndPlatform(session.DeviceId) - if err := sendToPushProxy(tmpMessage); err != nil { - return err - } + go sendToPushProxy(tmpMessage) if einterfaces.GetMetricsInterface() != nil { einterfaces.GetMetricsInterface().IncrementPostSentPush() @@ -531,9 +531,7 @@ func ClearPushNotification(userId string, channelId string) *model.AppError { for _, session := range sessions { tmpMessage := *model.PushNotificationFromJson(strings.NewReader(msg.ToJson())) tmpMessage.SetDeviceIdAndPlatform(session.DeviceId) - if err := sendToPushProxy(tmpMessage); err != nil { - return err - } + go sendToPushProxy(tmpMessage) } return nil |