Changed sendNotificationsAndForget to be synchronous and called as a go func

Этот коммит содержится в:
hmhealey
2016-02-04 11:45:19 -05:00
родитель f935be121c
Коммит 21318b7505

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

@@ -267,7 +267,7 @@ func handlePostEventsAndForget(c *Context, post *model.Post, triggerWebhooks boo
members = result.Data.([]model.ChannelMember)
}
sendNotificationsAndForget(c, post, team, channel, profiles, members)
go sendNotifications(c, post, team, channel, profiles, members)
go checkForOutOfChannelMentions(c, post, channel, profiles, members)
var user *model.User
@@ -433,9 +433,7 @@ func handleWebhookEventsAndForget(c *Context, post *model.Post, team *model.Team
}
func sendNotificationsAndForget(c *Context, post *model.Post, team *model.Team, channel *model.Channel, profileMap map[string]*model.User, members []model.ChannelMember) {
go func() {
func sendNotifications(c *Context, post *model.Post, team *model.Team, channel *model.Channel, profileMap map[string]*model.User, members []model.ChannelMember) {
var channelName string
var bodyText string
var subjectText string
@@ -719,7 +717,6 @@ func sendNotificationsAndForget(c *Context, post *model.Post, team *model.Team,
}
PublishAndForget(message)
}()
}
func updateMentionCountAndForget(channelId, userId string) {