From 5e69ce099f521aa49fc267c62235c003eae530ff Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 3 Oct 2017 10:53:53 -0500 Subject: Goroutine wranglin (#7556) * goroutine wranglin * synchronize WebConn.WritePump --- app/reaction.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'app/reaction.go') diff --git a/app/reaction.go b/app/reaction.go index debf75f7a..bf0d20e2b 100644 --- a/app/reaction.go +++ b/app/reaction.go @@ -18,7 +18,9 @@ func (a *App) SaveReactionForPost(reaction *model.Reaction) (*model.Reaction, *m } else { reaction = result.Data.(*model.Reaction) - go a.sendReactionEvent(model.WEBSOCKET_EVENT_REACTION_ADDED, reaction, post) + a.Go(func() { + a.sendReactionEvent(model.WEBSOCKET_EVENT_REACTION_ADDED, reaction, post) + }) return reaction, nil } @@ -41,7 +43,9 @@ func (a *App) DeleteReactionForPost(reaction *model.Reaction) *model.AppError { if result := <-a.Srv.Store.Reaction().Delete(reaction); result.Err != nil { return result.Err } else { - go a.sendReactionEvent(model.WEBSOCKET_EVENT_REACTION_REMOVED, reaction, post) + a.Go(func() { + a.sendReactionEvent(model.WEBSOCKET_EVENT_REACTION_REMOVED, reaction, post) + }) } return nil -- cgit v1.2.3-1-g7c22