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/command_echo.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/command_echo.go') diff --git a/app/command_echo.go b/app/command_echo.go index 61a24b59a..404736aa4 100644 --- a/app/command_echo.go +++ b/app/command_echo.go @@ -77,7 +77,7 @@ func (me *EchoProvider) DoCommand(a *App, args *model.CommandArgs, message strin } echoSem <- true - go func() { + a.Go(func() { defer func() { <-echoSem }() post := &model.Post{} post.ChannelId = args.ChannelId @@ -91,7 +91,7 @@ func (me *EchoProvider) DoCommand(a *App, args *model.CommandArgs, message strin if _, err := a.CreatePostMissingChannel(post, true); err != nil { l4g.Error(args.T("api.command_echo.create.app_error"), err) } - }() + }) return &model.CommandResponse{} } -- cgit v1.2.3-1-g7c22