diff options
author | Christopher Speller <crspeller@gmail.com> | 2017-01-03 09:53:59 -0500 |
---|---|---|
committer | enahum <nahumhbl@gmail.com> | 2017-01-03 11:53:59 -0300 |
commit | 42e04d92c47dd7226b7e28e396f8d8d6f36e053b (patch) | |
tree | e0f69e9a9400c8e562558affe8f2d86444f16aab /api/post.go | |
parent | 547524e5ad502e670ba3d2c2ec18f061ceff95ff (diff) | |
download | chat-42e04d92c47dd7226b7e28e396f8d8d6f36e053b.tar.gz chat-42e04d92c47dd7226b7e28e396f8d8d6f36e053b.tar.bz2 chat-42e04d92c47dd7226b7e28e396f8d8d6f36e053b.zip |
Adding memcache to getchannel (#4928)
Diffstat (limited to 'api/post.go')
-rw-r--r-- | api/post.go | 5 |
1 files changed, 3 insertions, 2 deletions
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 |