From 42e04d92c47dd7226b7e28e396f8d8d6f36e053b Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Tue, 3 Jan 2017 09:53:59 -0500 Subject: Adding memcache to getchannel (#4928) --- api/post.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'api/post.go') diff --git a/api/post.go b/api/post.go index 5cce766c0..354fe35db 100644 --- a/api/post.go +++ b/api/post.go @@ -61,7 +61,7 @@ func createPost(c *Context, w http.ResponseWriter, r *http.Request) { } post.UserId = c.Session.UserId - cchan := Srv.Store.Channel().Get(post.ChannelId) + cchan := Srv.Store.Channel().Get(post.ChannelId, true) if !HasPermissionToChannelContext(c, post.ChannelId, model.PERMISSION_CREATE_POST) { return @@ -166,6 +166,7 @@ func CreatePost(c *Context, post *model.Post, triggerWebhooks bool) (*model.Post } } + InvalidateCacheForChannel(rpost.ChannelId) InvalidateCacheForChannelPosts(rpost.ChannelId) handlePostEvents(c, rpost, triggerWebhooks) @@ -245,7 +246,7 @@ func CreateWebhookPost(c *Context, channelId, text, overrideUsername, overrideIc func handlePostEvents(c *Context, post *model.Post, triggerWebhooks bool) { tchan := Srv.Store.Team().Get(c.TeamId) - cchan := Srv.Store.Channel().Get(post.ChannelId) + cchan := Srv.Store.Channel().Get(post.ChannelId, true) uchan := Srv.Store.User().Get(post.UserId) var team *model.Team -- cgit v1.2.3-1-g7c22