summaryrefslogtreecommitdiffstats
path: root/store/sql_post_store.go
diff options
context:
space:
mode:
authorKyo Nguyen <canhlinh.lienson@gmail.com>2016-09-19 19:30:41 +0700
committerJoram Wilander <jwawilander@gmail.com>2016-09-19 08:30:41 -0400
commit2ca751febff968ddad65a7f55bffde631392c093 (patch)
tree3532d88bf33b1a78e2327c0e074a0ea1d669d4e1 /store/sql_post_store.go
parent33eda94db33417c839499b1b3e0330a4fdd1de19 (diff)
downloadchat-2ca751febff968ddad65a7f55bffde631392c093.tar.gz
chat-2ca751febff968ddad65a7f55bffde631392c093.tar.bz2
chat-2ca751febff968ddad65a7f55bffde631392c093.zip
Fix leaking goroutines in store calls (#3993). (#4021)
Diffstat (limited to 'store/sql_post_store.go')
-rw-r--r--store/sql_post_store.go36
1 files changed, 18 insertions, 18 deletions
diff --git a/store/sql_post_store.go b/store/sql_post_store.go
index 3b7e9d97a..212492df0 100644
--- a/store/sql_post_store.go
+++ b/store/sql_post_store.go
@@ -48,7 +48,7 @@ func (s SqlPostStore) CreateIndexesIfNotExists() {
}
func (s SqlPostStore) Save(post *model.Post) StoreChannel {
- storeChannel := make(StoreChannel)
+ storeChannel := make(StoreChannel, 1)
go func() {
result := StoreResult{}
@@ -95,7 +95,7 @@ func (s SqlPostStore) Save(post *model.Post) StoreChannel {
}
func (s SqlPostStore) Update(oldPost *model.Post, newMessage string, newHashtags string) StoreChannel {
- storeChannel := make(StoreChannel)
+ storeChannel := make(StoreChannel, 1)
go func() {
result := StoreResult{}
@@ -140,7 +140,7 @@ func (s SqlPostStore) Update(oldPost *model.Post, newMessage string, newHashtags
}
func (s SqlPostStore) GetFlaggedPosts(userId string, offset int, limit int) StoreChannel {
- storeChannel := make(StoreChannel)
+ storeChannel := make(StoreChannel, 1)
go func() {
result := StoreResult{}
pl := &model.PostList{}
@@ -165,7 +165,7 @@ func (s SqlPostStore) GetFlaggedPosts(userId string, offset int, limit int) Stor
}
func (s SqlPostStore) Get(id string) StoreChannel {
- storeChannel := make(StoreChannel)
+ storeChannel := make(StoreChannel, 1)
go func() {
result := StoreResult{}
@@ -211,7 +211,7 @@ type etagPosts struct {
}
func (s SqlPostStore) GetEtag(channelId string) StoreChannel {
- storeChannel := make(StoreChannel)
+ storeChannel := make(StoreChannel, 1)
go func() {
result := StoreResult{}
@@ -232,7 +232,7 @@ func (s SqlPostStore) GetEtag(channelId string) StoreChannel {
}
func (s SqlPostStore) Delete(postId string, time int64) StoreChannel {
- storeChannel := make(StoreChannel)
+ storeChannel := make(StoreChannel, 1)
go func() {
result := StoreResult{}
@@ -250,7 +250,7 @@ func (s SqlPostStore) Delete(postId string, time int64) StoreChannel {
}
func (s SqlPostStore) permanentDelete(postId string) StoreChannel {
- storeChannel := make(StoreChannel)
+ storeChannel := make(StoreChannel, 1)
go func() {
result := StoreResult{}
@@ -268,7 +268,7 @@ func (s SqlPostStore) permanentDelete(postId string) StoreChannel {
}
func (s SqlPostStore) permanentDeleteAllCommentByUser(userId string) StoreChannel {
- storeChannel := make(StoreChannel)
+ storeChannel := make(StoreChannel, 1)
go func() {
result := StoreResult{}
@@ -286,7 +286,7 @@ func (s SqlPostStore) permanentDeleteAllCommentByUser(userId string) StoreChanne
}
func (s SqlPostStore) PermanentDeleteByUser(userId string) StoreChannel {
- storeChannel := make(StoreChannel)
+ storeChannel := make(StoreChannel, 1)
go func() {
result := StoreResult{}
@@ -343,7 +343,7 @@ func (s SqlPostStore) PermanentDeleteByUser(userId string) StoreChannel {
}
func (s SqlPostStore) GetPosts(channelId string, offset int, limit int) StoreChannel {
- storeChannel := make(StoreChannel)
+ storeChannel := make(StoreChannel, 1)
go func() {
result := StoreResult{}
@@ -390,7 +390,7 @@ func (s SqlPostStore) GetPosts(channelId string, offset int, limit int) StoreCha
}
func (s SqlPostStore) GetPostsSince(channelId string, time int64) StoreChannel {
- storeChannel := make(StoreChannel)
+ storeChannel := make(StoreChannel, 1)
go func() {
result := StoreResult{}
@@ -456,7 +456,7 @@ func (s SqlPostStore) GetPostsAfter(channelId string, postId string, numPosts in
}
func (s SqlPostStore) getPostsAround(channelId string, postId string, numPosts int, offset int, before bool) StoreChannel {
- storeChannel := make(StoreChannel)
+ storeChannel := make(StoreChannel, 1)
go func() {
result := StoreResult{}
@@ -546,7 +546,7 @@ func (s SqlPostStore) getPostsAround(channelId string, postId string, numPosts i
}
func (s SqlPostStore) getRootPosts(channelId string, offset int, limit int) StoreChannel {
- storeChannel := make(StoreChannel)
+ storeChannel := make(StoreChannel, 1)
go func() {
result := StoreResult{}
@@ -567,7 +567,7 @@ func (s SqlPostStore) getRootPosts(channelId string, offset int, limit int) Stor
}
func (s SqlPostStore) getParentsPosts(channelId string, offset int, limit int) StoreChannel {
- storeChannel := make(StoreChannel)
+ storeChannel := make(StoreChannel, 1)
go func() {
result := StoreResult{}
@@ -624,7 +624,7 @@ var specialSearchChar = []string{
}
func (s SqlPostStore) Search(teamId string, userId string, params *model.SearchParams) StoreChannel {
- storeChannel := make(StoreChannel)
+ storeChannel := make(StoreChannel, 1)
go func() {
result := StoreResult{}
@@ -807,7 +807,7 @@ func (s SqlPostStore) Search(teamId string, userId string, params *model.SearchP
}
func (s SqlPostStore) AnalyticsUserCountsWithPostsByDay(teamId string) StoreChannel {
- storeChannel := make(StoreChannel)
+ storeChannel := make(StoreChannel, 1)
go func() {
result := StoreResult{}
@@ -880,7 +880,7 @@ func (s SqlPostStore) AnalyticsUserCountsWithPostsByDay(teamId string) StoreChan
}
func (s SqlPostStore) AnalyticsPostCountsByDay(teamId string) StoreChannel {
- storeChannel := make(StoreChannel)
+ storeChannel := make(StoreChannel, 1)
go func() {
result := StoreResult{}
@@ -953,7 +953,7 @@ func (s SqlPostStore) AnalyticsPostCountsByDay(teamId string) StoreChannel {
}
func (s SqlPostStore) AnalyticsPostCount(teamId string, mustHaveFile bool, mustHaveHashtag bool) StoreChannel {
- storeChannel := make(StoreChannel)
+ storeChannel := make(StoreChannel, 1)
go func() {
result := StoreResult{}