summaryrefslogtreecommitdiffstats
path: root/api/post.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2017-01-03 09:53:59 -0500
committerenahum <nahumhbl@gmail.com>2017-01-03 11:53:59 -0300
commit42e04d92c47dd7226b7e28e396f8d8d6f36e053b (patch)
treee0f69e9a9400c8e562558affe8f2d86444f16aab /api/post.go
parent547524e5ad502e670ba3d2c2ec18f061ceff95ff (diff)
downloadchat-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.go5
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