summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorChris <ccbrown112@gmail.com>2018-03-02 10:49:18 -0600
committerJoram Wilander <jwawilander@gmail.com>2018-03-02 16:49:18 +0000
commit4ebf9746905c845ee3874f87478d7450391680d8 (patch)
tree03163cd0809b2ae8c11e774ea5fbec2dff9d4e59 /api
parent2b3b6051d265edf131d006b2eb14f55284faf1e5 (diff)
downloadchat-4ebf9746905c845ee3874f87478d7450391680d8.tar.gz
chat-4ebf9746905c845ee3874f87478d7450391680d8.tar.bz2
chat-4ebf9746905c845ee3874f87478d7450391680d8.zip
remove `go Publish(...)` idiom (#8373)
Diffstat (limited to 'api')
-rw-r--r--api/post.go5
-rw-r--r--api/websocket_test.go2
2 files changed, 2 insertions, 5 deletions
diff --git a/api/post.go b/api/post.go
index 192dc0abc..bed2f3fdb 100644
--- a/api/post.go
+++ b/api/post.go
@@ -136,10 +136,7 @@ func saveIsPinnedPost(c *Context, w http.ResponseWriter, r *http.Request, isPinn
message := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_POST_EDITED, "", rpost.ChannelId, "", nil)
message.Add("post", c.App.PostWithProxyAddedToImageURLs(rpost).ToJson())
-
- c.App.Go(func() {
- c.App.Publish(message)
- })
+ c.App.Publish(message)
c.App.InvalidateCacheForChannelPosts(rpost.ChannelId)
diff --git a/api/websocket_test.go b/api/websocket_test.go
index 0a39a012f..a3c716abd 100644
--- a/api/websocket_test.go
+++ b/api/websocket_test.go
@@ -227,7 +227,7 @@ func TestWebSocketEvent(t *testing.T) {
}
evt2 := model.NewWebSocketEvent(model.WEBSOCKET_EVENT_TYPING, "", "somerandomid", "", nil)
- go th.App.Publish(evt2)
+ th.App.Publish(evt2)
time.Sleep(300 * time.Millisecond)
eventHit = false