diff options
author | Chris <ccbrown112@gmail.com> | 2017-10-03 10:53:53 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-03 10:53:53 -0500 |
commit | 5e69ce099f521aa49fc267c62235c003eae530ff (patch) | |
tree | c7177e4cac419082753225819f62d07c8b5671e8 /app/reaction.go | |
parent | bfe7955fb0c72bb6f3e0a1e0aaca70cff27d7ddc (diff) | |
download | chat-5e69ce099f521aa49fc267c62235c003eae530ff.tar.gz chat-5e69ce099f521aa49fc267c62235c003eae530ff.tar.bz2 chat-5e69ce099f521aa49fc267c62235c003eae530ff.zip |
Goroutine wranglin (#7556)
* goroutine wranglin
* synchronize WebConn.WritePump
Diffstat (limited to 'app/reaction.go')
-rw-r--r-- | app/reaction.go | 8 |
1 files changed, 6 insertions, 2 deletions
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 |